From: Timo Sirainen Date: Wed, 3 Sep 2025 09:20:14 +0000 (+0300) Subject: lib-storage: Don't try to add attachment flags if stream only has message header X-Git-Tag: 2.4.2~95 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28f667ae4455f3296d20822bf2f594200fee9e62;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Don't try to add attachment flags if stream only has message header 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. --- diff --git a/src/lib-storage/index/index-mail.c b/src/lib-storage/index/index-mail.c index 3c70bd9631..dfb76e9a35 100644 --- a/src/lib-storage/index/index-mail.c +++ b/src/lib-storage/index/index-mail.c @@ -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;