]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: LAYOUT=index rebuild - Remove existence check
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 5 Oct 2022 12:27:31 +0000 (15:27 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 18 Oct 2022 11:54:03 +0000 (11:54 +0000)
It's not needed.

src/lib-storage/list/mail-storage-list-index-rebuild.c

index 0334144b8d466a9c0bad2f289febb03d9ca8d557..38129b13d3a63d8c196d3f4478867e7ac311e71a 100644 (file)
@@ -343,7 +343,6 @@ mail_storage_list_index_try_create(struct mail_storage_list_index_rebuild_ctx *c
        struct mail_storage *storage = ctx->storage;
        struct mailbox *box;
        struct mailbox_update update;
-       enum mailbox_existence existence;
        string_t *name = t_str_new(128);
        unsigned char randomness[8];
        int ret;
@@ -363,14 +362,7 @@ mail_storage_list_index_try_create(struct mail_storage_list_index_rebuild_ctx *c
                guid_128_to_string(guid_p));
 
        box->corrupted_mailbox_name = TRUE;
-       if (mailbox_exists(box, FALSE, &existence) < 0) {
-               mail_storage_set_critical(storage,
-                       "List rebuild: Couldn't lookup mailbox %s existence: %s",
-                       str_c(name), mailbox_get_last_internal_error(box, NULL));
-               ret = -1;
-       } else if (existence != MAILBOX_EXISTENCE_NONE) {
-               ret = 0;
-       } else if ((ret = mail_storage_list_mailbox_create(box, &update)) <= 0)
+       if ((ret = mail_storage_list_mailbox_create(box, &update)) <= 0)
                ;
        else if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FORCE_RESYNC) < 0) {
                mail_storage_set_critical(storage,