Commit cc213415 authored by Mickaël Guessant's avatar Mickaël Guessant

IMAP: implement ON search filter

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@2492 3d1905a2-6b24-0410-a738-b14d5a86fcbd
parent 586b4295
......@@ -1412,7 +1412,7 @@ public class ImapConnection extends AbstractConnection {
return session.gte("messageSize", tokens.nextToken());
} else if ("SMALLER".equals(token)) {
return session.lt("messageSize", tokens.nextToken());
} else if (token.startsWith("SENT") || "SINCE".equals(token) || "BEFORE".equals(token)) {
} else if (token.startsWith("SENT") || "SINCE".equals(token) || "BEFORE".equals(token) || "ON".equals(token)) {
return appendDateSearchParam(tokens, token);
} else if ("SEEN".equals(token)) {
return session.isTrue("read");
......
......@@ -368,6 +368,15 @@ public class TestImap extends AbstractImapTestCase {
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
}
public void testIcedoveHeaderFetch() throws IOException {
resetTestFolder();
appendMessage();
writeLine(". UID FETCH 1:* (RFC822.SIZE RFC822.HEADER FLAGS)");
assertEquals(". OK UID FETCH completed", readFullAnswer("."));
}
public void testSearchHeader() throws IOException {
resetTestFolder();
appendMessage();
......@@ -420,6 +429,14 @@ public class TestImap extends AbstractImapTestCase {
assertEquals(". OK SEARCH completed", readFullAnswer("."));
}
public void testSearchSinceOn() throws IOException {
resetTestFolder();
appendMessage();
writeLine(". UID SEARCH OR SINCE 1-Jan-2012 ON 1-Jan-2012 ALL");
assertEquals(". OK SEARCH completed", readFullAnswer("."));
}
public void testSearchText() throws IOException {
resetTestFolder();
appendMessage();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment