]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: mailbox_list_index_refresh_force() - Handle readonly storage
authorMarco Bettini <marco.bettini@open-xchange.com>
Mon, 18 Sep 2023 14:12:50 +0000 (14:12 +0000)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 6 Oct 2023 16:00:06 +0000 (16:00 +0000)
src/lib-storage/list/mailbox-list-index.c

index a069f40ef22a9bfca4dae4f517ee08279847b71b..1e55db8aed055afb1248e1a397c91b85924a64b5 100644 (file)
@@ -647,6 +647,10 @@ int mailbox_list_index_refresh_force(struct mailbox_list *list)
                        /* I/O failure - don't try to handle corruption,
                           since we don't have the latest state. */
                        handle_corruption = FALSE;
+                       if (ilist->index_error_code == MAIL_INDEX_ERROR_CODE_NO_ACCESS)
+                               ret = mail_index_refresh(ilist->index);
+                       if (ret >= 0)
+                               ret = mailbox_list_index_parse(list, view, FALSE);
                }
        } else {
                ret = mailbox_list_index_parse(list, view, FALSE);