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

Fail gracefully on multiple messages delete

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@318 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2009-02-03 16:18:29 +00:00
parent ad851bc6ce
commit fb414a9955

View File

@ -349,15 +349,19 @@ public class ImapConnection extends AbstractConnection {
} }
sendClient(commandId + " OK STORE completed"); sendClient(commandId + " OK STORE completed");
} else if ("copy".equalsIgnoreCase(subcommand)) { } else if ("copy".equalsIgnoreCase(subcommand)) {
try {
long uid = Long.parseLong(tokens.nextToken()); long uid = Long.parseLong(tokens.nextToken());
ExchangeSession.Message message = messages.getByUid(uid); ExchangeSession.Message message = messages.getByUid(uid);
String targetName = BASE64MailboxDecoder.decode(tokens.nextToken()); String targetName = BASE64MailboxDecoder.decode(tokens.nextToken());
try { try {
session.copyMessage(message.messageUrl, targetName); session.copyMessage(message.messageUrl, targetName);
sendClient(commandId + " OK rename completed"); sendClient(commandId + " OK copy completed");
} catch (HttpException e) { } catch (HttpException e) {
sendClient(commandId + " NO " + e.getReason()); sendClient(commandId + " NO " + e.getReason());
} }
} catch (NumberFormatException nfe) {
sendClient(commandId + " NO unable to copy multiple messages");
}
} }
} else { } else {
sendClient(commandId + " BAD command unrecognized"); sendClient(commandId + " BAD command unrecognized");