]> 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)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Tue, 1 Nov 2022 11:36:52 +0000 (12:36 +0100)
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 e65579ff1f8252a86b94ff6702442b8c41f8449c..34b5e6118560f2b742d7d86c8c0912e15d2aa95b 100644 (file)
@@ -544,7 +544,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;
        }