mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
IMAP: return all search results uids on a single line for Wanderlust
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1858 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
724fbc86e8
commit
0b786e0501
@ -314,13 +314,12 @@ public class ImapConnection extends AbstractConnection {
|
||||
|
||||
} else if ("search".equalsIgnoreCase(subcommand)) {
|
||||
List<Long> uidList = handleSearch(tokens);
|
||||
if (uidList.isEmpty()) {
|
||||
sendClient("* SEARCH");
|
||||
} else {
|
||||
for (long uid : uidList) {
|
||||
sendClient("* SEARCH " + uid);
|
||||
}
|
||||
StringBuilder buffer = new StringBuilder("* SEARCH");
|
||||
for (long uid : uidList) {
|
||||
buffer.append(' ');
|
||||
buffer.append(uid);
|
||||
}
|
||||
sendClient(buffer.toString());
|
||||
sendClient(commandId + " OK SEARCH completed");
|
||||
|
||||
} else if ("store".equalsIgnoreCase(subcommand)) {
|
||||
|
@ -48,6 +48,11 @@ public class TestImap extends AbstractImapTestCase {
|
||||
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
||||
}
|
||||
|
||||
public void testSelectRoot() throws IOException {
|
||||
writeLine(". SELECT \"\"");
|
||||
assertEquals(". OK [READ-WRITE] SELECT completed", readFullAnswer("."));
|
||||
}
|
||||
|
||||
public void testFetchFlags() throws IOException {
|
||||
writeLine(". UID FETCH 1:* (FLAGS)");
|
||||
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
||||
@ -332,4 +337,18 @@ public class TestImap extends AbstractImapTestCase {
|
||||
clientSocket.close();
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
|
||||
public void testSearchCharset() throws IOException {
|
||||
testSelectInbox();
|
||||
writeLine("UID SEARCH CHARSET UTF-8 (HEADER SUBJECT testé)");
|
||||
assertEquals(". OK SEARCH completed", readFullAnswer("."));
|
||||
}
|
||||
|
||||
public void testWanderLust() throws IOException {
|
||||
testSelectInbox();
|
||||
writeLine(". uid fetch 1:* (body.peek[header.fields (Subject From To Cc Date Message-Id References In-Reply-To Delivered-To)] rfc822.size flags)");
|
||||
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user