Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2988c86

Browse files
committedMar 11, 2025·
feat: protect the Date header
1 parent e9e1c3d commit 2988c86

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
@@ -911,6 +911,14 @@ impl MimeFactory {
911911
} else {
912912
unprotected_headers.push(header.clone());
913913
}
914+
} else if is_encrypted && header_name == "date" {
915+
protected_headers.push(header.clone());
916+
unprotected_headers.push((
917+
"Date",
918+
mail_builder::headers::HeaderType::Raw(
919+
"Thu, 01 Jan 1970 00:00:00 +0000".into(),
920+
),
921+
));
914922
} else if is_encrypted {
915923
protected_headers.push(header.clone());
916924

@@ -921,8 +929,7 @@ impl MimeFactory {
921929
mail_builder::headers::raw::Raw::new("[...]").into(),
922930
));
923931
}
924-
"date"
925-
| "in-reply-to"
932+
"in-reply-to"
926933
| "references"
927934
| "auto-submitted"
928935
| "chat-version"

0 commit comments

Comments
 (0)
Please sign in to comment.