From: Timo Sirainen Date: Mon, 17 Feb 2025 10:22:25 +0000 (+0200) Subject: lib-storage: Clear storage errors if iteration failed due to no mailbox attribute... X-Git-Tag: 2.4.1~168 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b209e251918ca6d255bde809ce533c3c820ed417;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Clear storage errors if iteration failed due to no mailbox attribute dict 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. --- diff --git a/src/lib-storage/index/index-attribute.c b/src/lib-storage/index/index-attribute.c index 491b7794b6..2d145312e2 100644 --- a/src/lib-storage/index/index-attribute.c +++ b/src/lib-storage/index/index-attribute.c @@ -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));