1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 03:02:22 -05:00

IMAP: fix 3426383, implement CHARSET in SEARCH command, allow ASCII and UTF-8

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1826 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-10-24 22:45:57 +00:00
parent 396f6790c1
commit 73edf89a10

View File

@ -63,7 +63,7 @@ public class ImapConnection extends AbstractConnection {
* @param clientSocket IMAP client socket
*/
public ImapConnection(Socket clientSocket) {
super(ImapConnection.class.getSimpleName(), clientSocket, null);
super(ImapConnection.class.getSimpleName(), clientSocket, "UTF-8");
}
@Override
@ -878,6 +878,11 @@ public class ImapConnection extends AbstractConnection {
condition = session.or();
} else if (token.startsWith("OR ")) {
condition = appendOrSearchParams(token, conditions);
} else if ("CHARSET".equals(token)) {
String charset = tokens.nextQuotedToken().toUpperCase();
if (!("ASCII".equals(charset) || "UTF-8".equals(charset))) {
throw new IOException("Unsupported charset "+charset);
}
} else {
if (condition == null) {
condition = session.and();