]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Don't try to add attachment flags if stream only has message header
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 3 Sep 2025 09:20:14 +0000 (12:20 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Tue, 14 Oct 2025 11:28:44 +0000 (11:28 +0000)
This could have caused wrong attachment flag to be added with imapc format,
because the body wasn't parsed. Other mailbox formats always had a message
body included in the stream.

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

index 3c70bd96313e134221d1d6cded6e02b67c836201..dfb76e9a358c9e35f9618abf7f68a707e95d560d 100644 (file)
@@ -1386,7 +1386,7 @@ int index_mail_init_stream(struct index_mail *mail,
                        index_mail_stream_destroy_callback, mail);
        }
 
-       bool want_attachment_kw =
+       bool want_attachment_kw = !data->stream_has_only_header &&
                index_mail_want_attachment_keywords_on_fetch(mail);
        if (want_attachment_kw) {
                data->access_part |= PARSE_HDR | PARSE_BODY;