]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Clear storage errors if iteration failed due to no mailbox attribute...
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 17 Feb 2025 10:22:25 +0000 (12:22 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 21 Feb 2025 08:15:43 +0000 (08:15 +0000)
This doesn't normally matter, but if there are error handling bugs elsewhere
this error might wrongly show up in logs and cause confusion. It's better to
log "Unknown error" in that case.

src/lib-storage/index/index-attribute.c

index 491b7794b60f7ebcb5baea51e4a0d6848adcb478..2d145312e23955d44228ff9041b9c47d1cbed17e 100644 (file)
@@ -283,8 +283,10 @@ index_storage_attribute_iter_init(struct mailbox *box,
        iter = i_new(struct index_storage_attribute_iter, 1);
        iter->iter.box = box;
        if (index_storage_get_dict(box, type_flags, &dict, &mailbox_prefix) < 0) {
-               if (mailbox_get_last_mail_error(box) == MAIL_ERROR_NOTPOSSIBLE)
+               if (mailbox_get_last_mail_error(box) == MAIL_ERROR_NOTPOSSIBLE) {
+                       mail_storage_clear_error(box->storage);
                        iter->dict_disabled = TRUE;
+               }
        } else {
                iter->prefix = i_strdup(key_get_prefixed(type_flags, mailbox_prefix,
                                                         prefix));