]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
maildir: If mailbox create fails, don't try to apply mailbox_update changes
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 27 Oct 2022 21:56:29 +0000 (00:56 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 31 Oct 2022 14:52:37 +0000 (14:52 +0000)
This was especially causing problems with mailbox GUID mismatches in dsync.
The mismatch wasn't automatically fixed, because mailbox_create() incorrectly
kept updating the mailbox GUID for the already existing mailbox.

Fixes errors such as:
Remote lost mailbox GUID ... (maybe it was just deleted?)

src/lib-storage/index/maildir/maildir-storage.c

index 20f036f15011ec5730d10bc11b79e65a6c665ac7..c6a69729e29a94a35f3cf520333b5af05dba069c 100644 (file)
@@ -538,7 +538,7 @@ maildir_mailbox_create(struct mailbox *box, const struct mailbox_update *update,
                if (maildir_create_shared(box) < 0)
                        ret = -1;
        }
-       if (update != NULL) {
+       if (ret == 0 && update != NULL) {
                if (maildir_mailbox_update(box, update) < 0)
                        ret = -1;
        }