From: Timo Sirainen Date: Mon, 21 Oct 2013 17:47:53 +0000 (+0300) Subject: imap: COPY allows transaction commit now to fail with "some messages were expunged". X-Git-Tag: 2.2.7~71 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec0dffdfba77aa15cb53a2b0a5fa3280a8c23ee8;p=thirdparty%2Fdovecot%2Fcore.git imap: COPY allows transaction commit now to fail with "some messages were expunged". --- diff --git a/src/imap/cmd-copy.c b/src/imap/cmd-copy.c index 57619f56b1..e066752a59 100644 --- a/src/imap/cmd-copy.c +++ b/src/imap/cmd-copy.c @@ -127,9 +127,15 @@ static bool cmd_copy_full(struct client_command_context *cmd, bool move) msg = t_str_new(256); if (ret <= 0) mailbox_transaction_rollback(&t); - else if (mailbox_transaction_commit_get_changes(&t, &changes) < 0) - ret = -1; - else if (copy_count == 0) { + else if (mailbox_transaction_commit_get_changes(&t, &changes) < 0) { + if (mailbox_get_last_mail_error(destbox) == MAIL_ERROR_EXPUNGED) { + /* storage backend didn't notice the expunge until + at commit time. */ + ret = 0; + } else { + ret = -1; + } + } else if (copy_count == 0) { str_append(msg, "OK No messages found."); pool_unref(&changes.pool); } else if (seq_range_count(&changes.saved_uids) == 0 ||