mirror of
https://github.com/chatmail/core.git
synced 2026-05-04 13:56:30 +03:00
fix: Save mime headers for messages not signed with a known key (#4557)
If a message is unsigned or signed with an unknown key, `MimeMessage::was_encrypted()` returns false. So, it mustn't be checked when deciding whether to look into `MimeMessage::decoded_data`. Looking through git history one can see that it's just a wrong check left in the code for historical reasons.
This commit is contained in:
@@ -1068,7 +1068,7 @@ async fn add_parts(
|
||||
let mut save_mime_modified = mime_parser.is_mime_modified;
|
||||
|
||||
let mime_headers = if save_mime_headers || save_mime_modified {
|
||||
let headers = if mime_parser.was_encrypted() && !mime_parser.decoded_data.is_empty() {
|
||||
let headers = if !mime_parser.decoded_data.is_empty() {
|
||||
mime_parser.decoded_data.clone()
|
||||
} else {
|
||||
imf_raw.to_vec()
|
||||
|
||||
Reference in New Issue
Block a user