]> 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)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Thu, 20 Oct 2022 08:55:33 +0000 (10:55 +0200)
It's not needed.

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

index 0f93aeb10f284d3a0a7d593bf2a94e14c15cf6cd..7fa47411168e842353da254da306d2657c82994c 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,