IMAP: mark examine command READ-ONLY

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@477 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-03-26 21:54:50 +00:00
parent a0ebe90328
commit bac51a25a0
1 changed files with 10 additions and 5 deletions

View File

@ -147,7 +147,11 @@ public class ImapConnection extends AbstractConnection {
} }
sendClient("* FLAGS (\\Answered \\Deleted \\Draft \\Flagged \\Seen $Forwarded Junk)"); sendClient("* FLAGS (\\Answered \\Deleted \\Draft \\Flagged \\Seen $Forwarded Junk)");
sendClient("* OK [PERMANENTFLAGS (\\Answered \\Deleted \\Draft \\Flagged \\Seen $Forwarded Junk \\*)]"); sendClient("* OK [PERMANENTFLAGS (\\Answered \\Deleted \\Draft \\Flagged \\Seen $Forwarded Junk \\*)]");
sendClient(commandId + " OK [READ-WRITE] " + command + " completed"); if ("select".equalsIgnoreCase(command)) {
sendClient(commandId + " OK [READ-WRITE] " + command + " completed");
} else {
sendClient(commandId + " OK [READ-ONLY] " + command + " completed");
}
} else { } else {
sendClient(commandId + " BAD command unrecognized"); sendClient(commandId + " BAD command unrecognized");
} }
@ -354,6 +358,7 @@ public class ImapConnection extends AbstractConnection {
sendClient(commandId + " OK APPEND completed"); sendClient(commandId + " OK APPEND completed");
} else if ("noop".equalsIgnoreCase(command) || "check".equalsIgnoreCase(command)) { } else if ("noop".equalsIgnoreCase(command) || "check".equalsIgnoreCase(command)) {
if (currentFolder != null) { if (currentFolder != null) {
DavGatewayTray.debug(command + " on " + currentFolder.folderName);
currentFolder = session.getFolder(currentFolder.folderName); currentFolder = session.getFolder(currentFolder.folderName);
messages = session.getAllMessages(currentFolder.folderUrl); messages = session.getAllMessages(currentFolder.folderUrl);
sendClient("* " + messages.size() + " EXISTS"); sendClient("* " + messages.size() + " EXISTS");
@ -440,14 +445,14 @@ public class ImapConnection extends AbstractConnection {
String message = buffer.toString(); String message = buffer.toString();
try { try {
if (commandId != null) { if (commandId != null) {
sendClient(commandId + " BAD unable to handle request: "+message); sendClient(commandId + " BAD unable to handle request: " + message);
} else { } else {
sendClient("* BYE unable to handle request: "+message); sendClient("* BYE unable to handle request: " + message);
} }
} catch (IOException e2) { } catch (IOException e2) {
DavGatewayTray.warn("Exception sending error to client", e2); DavGatewayTray.warn("Exception sending error to client", e2);
} }
DavGatewayTray.error("Exception handling client: "+message, e); DavGatewayTray.error("Exception handling client: " + message, e);
} finally { } finally {
close(); close();
} }
@ -695,7 +700,7 @@ public class ImapConnection extends AbstractConnection {
String headerName = tokens.nextToken().toLowerCase(); String headerName = tokens.nextToken().toLowerCase();
String value = tokens.nextToken(); String value = tokens.nextToken();
if ("message-id".equals(headerName)) { if ("message-id".equals(headerName)) {
value = "<"+value+">"; value = "<" + value + ">";
} }
conditions.append(operator).append("\"urn:schemas:mailheader:").append(headerName).append("\"='").append(value).append("'"); conditions.append(operator).append("\"urn:schemas:mailheader:").append(headerName).append("\"='").append(value).append("'");
} else if ("UID".equals(token)) { } else if ("UID".equals(token)) {