]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fix corrupted cache when adding attachment keywords
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 7 May 2021 17:37:02 +0000 (20:37 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 28 May 2021 13:27:52 +0000 (13:27 +0000)
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

index fff45d345dfd974310e4c720a55899f689e44a2c..0cad154d0ccb25c6cad08ce49753b128d83fad39 100644 (file)
@@ -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;