Skip to content

Commit c7cb423

Browse files
committed
feat: protect the Date header
1 parent b5fa655 commit c7cb423

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/mimefactory.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,14 @@ impl MimeFactory {
902902
} else {
903903
unprotected_headers.push(header.clone());
904904
}
905+
} else if is_encrypted && header_name == "date" {
906+
protected_headers.push(header.clone());
907+
unprotected_headers.push((
908+
"Date",
909+
mail_builder::headers::HeaderType::Raw(
910+
"Thu, 01 Jan 1970 00:00:00 +0000".into(),
911+
),
912+
));
905913
} else if is_encrypted {
906914
protected_headers.push(header.clone());
907915

@@ -912,8 +920,7 @@ impl MimeFactory {
912920
mail_builder::headers::raw::Raw::new("[...]").into(),
913921
));
914922
}
915-
"date"
916-
| "in-reply-to"
923+
"in-reply-to"
917924
| "references"
918925
| "auto-submitted"
919926
| "chat-version"

0 commit comments

Comments
 (0)