From aca34379e08f880ca58a4a0f0fac07e715b9dfd5 Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 7 Dec 2023 03:02:01 +0000 Subject: [PATCH] fix: add padlock to empty part if the whole message is empty parse_mime_recursive() skips empty text parts, so there may be no parts as the result of parsing. In this case an empty part is added. However, because it is added with parts.push() rather than add_single_part(), it is added without a padlock even if the message is encrypted. `do_add_single_part()` adds padlock (GuaranteeE2EE param) and should be used to add parts instead. --- src/mimeparser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mimeparser.rs b/src/mimeparser.rs index a24daa9da..f75cabd21 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -694,7 +694,7 @@ impl MimeMessage { } } - self.parts.push(part); + self.do_add_single_part(part); } if self.headers.contains_key("auto-submitted") {