From: Timo Sirainen Date: Mon, 14 Oct 2024 05:49:37 +0000 (+0300) Subject: lib-storage: Mailbox list rebuild - avoid opening mailbox on recovery name collision X-Git-Tag: 2.4.0~1434 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=218ea7c5ca5257d81e6a97e888bdbca92aebe453;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Mailbox list rebuild - avoid opening mailbox on recovery name collision If recovered-lost-folder-$guid already unexpectedly exists, there's no need to open it (at this point) to try to recover its name. This didn't really harm anything, so it mainly fixes the code logic to make sense. --- diff --git a/src/lib-storage/list/mail-storage-list-index-rebuild.c b/src/lib-storage/list/mail-storage-list-index-rebuild.c index 792f7977fb..f2d98ce400 100644 --- a/src/lib-storage/list/mail-storage-list-index-rebuild.c +++ b/src/lib-storage/list/mail-storage-list-index-rebuild.c @@ -381,7 +381,7 @@ mail_storage_list_index_try_create(struct mail_storage_list_index_rebuild_ctx *c } mailbox_free(&box); - if (ret < 0) + if (ret <= 0) return ret; /* open a second time to rename the mailbox to its original name,