]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: cmd-copy() - Document why we stop iterating at first expunged message
authorMarco Bettini <marco.bettini@open-xchange.com>
Thu, 16 Feb 2023 10:26:14 +0000 (10:26 +0000)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 22 May 2023 09:21:43 +0000 (09:21 +0000)
src/imap/cmd-copy.c

index 4a03af0fdbb6fcbfb7c5a84cf21202e3f220415b..1d95669f868d54bee8d2ff1dd9fe31a697c4d77a 100644 (file)
@@ -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;