diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index 7bb3bd4a9..c691e84d8 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -912,24 +912,22 @@ public class ImapStore extends Store ArrayList messages = new ArrayList(); try { - boolean gotSearchValues = false; ArrayList uids = new ArrayList(); List responses = searcher.search(); // for (ImapResponse response : responses) { - if (response.get(0).equals("SEARCH")) + if (response.mTag == null) { - gotSearchValues = true; - for (int i = 1, count = response.size(); i < count; i++) + if (response.get(0).equals("SEARCH")) { - uids.add(Integer.parseInt(response.getString(i))); + for (int i = 1, count = response.size(); i < count; i++) + { + uids.add(Integer.parseInt(response.getString(i))); + } } } } - if (gotSearchValues == false) - { - throw new MessagingException("Did not get proper search response"); - } + // Sort the uids in numerically ascending order Collections.sort(uids); for (int i = 0, count = uids.size(); i < count; i++)