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)) {
|
} else if ("search".equalsIgnoreCase(subcommand)) {
|
||||||
List<Long> uidList = handleSearch(tokens);
|
List<Long> uidList = handleSearch(tokens);
|
||||||
for (long uid : uidList) {
|
if (uidList.isEmpty()) {
|
||||||
sendClient("* SEARCH " + uid);
|
sendClient("* SEARCH");
|
||||||
|
} else {
|
||||||
|
for (long uid : uidList) {
|
||||||
|
sendClient("* SEARCH " + uid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sendClient(commandId + " OK SEARCH completed");
|
sendClient(commandId + " OK SEARCH completed");
|
||||||
|
|
||||||
|
@ -319,11 +323,15 @@ public class ImapConnection extends AbstractConnection {
|
||||||
sendClient(commandId + " NO no folder selected");
|
sendClient(commandId + " NO no folder selected");
|
||||||
} else {
|
} else {
|
||||||
List<Long> uidList = handleSearch(tokens);
|
List<Long> uidList = handleSearch(tokens);
|
||||||
int currentIndex = 0;
|
if (uidList.isEmpty()) {
|
||||||
for (ExchangeSession.Message message : currentFolder.messages) {
|
sendClient("* SEARCH");
|
||||||
currentIndex++;
|
} else {
|
||||||
if (uidList.contains(message.getImapUid())) {
|
int currentIndex = 0;
|
||||||
sendClient("* SEARCH " + currentIndex);
|
for (ExchangeSession.Message message : currentFolder.messages) {
|
||||||
|
currentIndex++;
|
||||||
|
if (uidList.contains(message.getImapUid())) {
|
||||||
|
sendClient("* SEARCH " + currentIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sendClient(commandId + " OK SEARCH completed");
|
sendClient(commandId + " OK SEARCH completed");
|
||||||
|
|
Loading…
Reference in New Issue