From: Marco Bettini Date: Thu, 16 Feb 2023 10:26:14 +0000 (+0000) Subject: imap: cmd-copy() - Document why we stop iterating at first expunged message X-Git-Tag: 2.4.0~2738 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92f9144bfa028902497bf3e7d554f3d68efd3f67;p=thirdparty%2Fdovecot%2Fcore.git imap: cmd-copy() - Document why we stop iterating at first expunged message --- diff --git a/src/imap/cmd-copy.c b/src/imap/cmd-copy.c index 4a03af0fdb..1d95669f86 100644 --- a/src/imap/cmd-copy.c +++ b/src/imap/cmd-copy.c @@ -129,6 +129,10 @@ static int fetch_and_copy(struct cmd_copy_context *copy_ctx, i_array_init(&src_uids, 64); ret = 1; while (mailbox_search_next(search_ctx, &mail) && ret > 0) { + /* RFCs require to rollback a COPY if any mails is expunged. + MOVE also needs to abort (but not rollback) to prevent + multiple parallel moves from trying to move the same + mails when it’s trying to move a huge number of mails. */ if (mail->expunged) { ret = 0; break;