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.
This commit is contained in:
link2xt
2023-12-07 03:02:01 +00:00
parent 1edd7045be
commit aca34379e0

View File

@@ -694,7 +694,7 @@ impl MimeMessage {
}
}
self.parts.push(part);
self.do_add_single_part(part);
}
if self.headers.contains_key("auto-submitted") {