From c8ac1fd03b7b626d379d6e47262f289c1a39ad3b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 7 May 2021 20:37:02 +0300 Subject: [PATCH] lib-storage: Fix corrupted cache when adding attachment keywords If IMAP BODYSTRUCTURE parsing fails, it means the BODYSTRUCTURE doesn't match the MIME parts. This likely means that one or both of them are corrupted. Handle this by deleting the email from cache, so this error won't keep repeating. --- src/lib-storage/mail.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib-storage/mail.c b/src/lib-storage/mail.c index fff45d345d..0cad154d0c 100644 --- a/src/lib-storage/mail.c +++ b/src/lib-storage/mail.c @@ -526,8 +526,8 @@ static int mail_parse_parts(struct mail *mail, struct message_part **parts_r) } if (imap_bodystructure_parse_full(structure, pmail->data_pool, parts_r, &error) < 0) { - mail_set_critical(mail, "imap_bodystructure_parse() failed: %s", - error); + mail_set_cache_corrupted(mail, MAIL_FETCH_IMAP_BODYSTRUCTURE, + error); return -1; } return 0; -- 2.47.3