diff --git a/provider_src/com/android/email/mail/store/ImapFolder.java b/provider_src/com/android/email/mail/store/ImapFolder.java index 3a9081131..2eefdfec3 100644 --- a/provider_src/com/android/email/mail/store/ImapFolder.java +++ b/provider_src/com/android/email/mail/store/ImapFolder.java @@ -557,7 +557,8 @@ class ImapFolder extends Folder { public Message[] getMessages(long startDate, long endDate, MessageRetrievalListener listener) throws MessagingException { String [] uids = null; - String command = generateDateRangeCommand(startDate, endDate, false); + String command = generateDateRangeCommand(startDate, endDate, false) + + " NOT DELETED"; LogUtils.d(Logging.LOG_TAG, "getMessages dateRange " + command.toString()); try { @@ -570,7 +571,8 @@ class ImapFolder extends Folder { // See b/11183568 LogUtils.d(Logging.LOG_TAG, e, "query failed %s, trying alternate", command.toString()); - command = generateDateRangeCommand(startDate, endDate, true); + command = generateDateRangeCommand(startDate, endDate, true) + + " NOT DELETED"; try { uids = searchForUids(command, true); } catch (ImapException e2) {