From: Timo Sirainen Date: Tue, 27 Oct 2020 13:13:39 +0000 (+0200) Subject: lib-storage: Fix error message when mailbox list index rebuild fails X-Git-Tag: 2.3.14.rc1~360 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=152214f576c9bd7b4dff25c93c72750c734b7fae;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Fix error message when mailbox list index rebuild fails The error needs to be copied to mailbox_list, otherwise it's just "Unknown internal list error". --- diff --git a/src/lib-storage/list/mailbox-list-index.c b/src/lib-storage/list/mailbox-list-index.c index 36132877b9..a588fb0080 100644 --- a/src/lib-storage/list/mailbox-list-index.c +++ b/src/lib-storage/list/mailbox-list-index.c @@ -604,16 +604,21 @@ list_handle_corruption_locked(struct mailbox_list *list, enum mail_storage_list_index_rebuild_reason reason) { struct mail_storage *const *storagep; + const char *errstr; + enum mail_error error; array_foreach(&list->ns->all_storages, storagep) { - if ((*storagep)->v.list_index_rebuild != NULL) { - if ((*storagep)->v.list_index_rebuild(*storagep, reason) < 0) - return -1; - else { - /* FIXME: implement a generic handler that - just lists mailbox directories in filesystem - and adds the missing ones to the index. */ - } + if ((*storagep)->v.list_index_rebuild == NULL) + continue; + + if ((*storagep)->v.list_index_rebuild(*storagep, reason) < 0) { + errstr = mail_storage_get_last_internal_error(*storagep, &error); + mailbox_list_set_error(list, error, errstr); + return -1; + } else { + /* FIXME: implement a generic handler that + just lists mailbox directories in filesystem + and adds the missing ones to the index. */ } } return mailbox_list_index_set_uncorrupted(list);