From: Timo Sirainen Date: Thu, 27 Oct 2022 21:56:29 +0000 (+0300) Subject: maildir: If mailbox create fails, don't try to apply mailbox_update changes X-Git-Tag: 2.3.20~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=94f620c4da4441937a4b07df36b479697368c532;p=thirdparty%2Fdovecot%2Fcore.git maildir: If mailbox create fails, don't try to apply mailbox_update changes 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?) --- diff --git a/src/lib-storage/index/maildir/maildir-storage.c b/src/lib-storage/index/maildir/maildir-storage.c index e65579ff1f..34b5e61185 100644 --- a/src/lib-storage/index/maildir/maildir-storage.c +++ b/src/lib-storage/index/maildir/maildir-storage.c @@ -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; }