mirror of
https://github.com/moparisthebest/davmail
synced 2025-01-13 06:28:19 -05:00
IMAP: send required "* SEARCH" on empty search response
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1070 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
3bdd897673
commit
a4716cf936
@ -287,8 +287,12 @@ public class ImapConnection extends AbstractConnection {
|
||||
|
||||
} else if ("search".equalsIgnoreCase(subcommand)) {
|
||||
List<Long> uidList = handleSearch(tokens);
|
||||
for (long uid : uidList) {
|
||||
sendClient("* SEARCH " + uid);
|
||||
if (uidList.isEmpty()) {
|
||||
sendClient("* SEARCH");
|
||||
} else {
|
||||
for (long uid : uidList) {
|
||||
sendClient("* SEARCH " + uid);
|
||||
}
|
||||
}
|
||||
sendClient(commandId + " OK SEARCH completed");
|
||||
|
||||
@ -319,11 +323,15 @@ public class ImapConnection extends AbstractConnection {
|
||||
sendClient(commandId + " NO no folder selected");
|
||||
} else {
|
||||
List<Long> uidList = handleSearch(tokens);
|
||||
int currentIndex = 0;
|
||||
for (ExchangeSession.Message message : currentFolder.messages) {
|
||||
currentIndex++;
|
||||
if (uidList.contains(message.getImapUid())) {
|
||||
sendClient("* SEARCH " + currentIndex);
|
||||
if (uidList.isEmpty()) {
|
||||
sendClient("* SEARCH");
|
||||
} else {
|
||||
int currentIndex = 0;
|
||||
for (ExchangeSession.Message message : currentFolder.messages) {
|
||||
currentIndex++;
|
||||
if (uidList.contains(message.getImapUid())) {
|
||||
sendClient("* SEARCH " + currentIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
sendClient(commandId + " OK SEARCH completed");
|
||||
|
Loading…
Reference in New Issue
Block a user