Skip to content

Commit 8f9b7d8

Browse files
committed
feat: protect the Date header
1 parent e1aa610 commit 8f9b7d8

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
@@ -906,6 +906,14 @@ impl MimeFactory {
906906
} else {
907907
unprotected_headers.push(header.clone());
908908
}
909+
} else if is_encrypted && header_name == "date" {
910+
protected_headers.push(header.clone());
911+
unprotected_headers.push((
912+
"Date",
913+
mail_builder::headers::HeaderType::Raw(
914+
"Thu, 01 Jan 1970 00:00:00 +0000".into(),
915+
),
916+
));
909917
} else if is_encrypted {
910918
protected_headers.push(header.clone());
911919

@@ -916,8 +924,7 @@ impl MimeFactory {
916924
mail_builder::headers::raw::Raw::new("[...]").into(),
917925
));
918926
}
919-
"date"
920-
| "in-reply-to"
927+
"in-reply-to"
921928
| "references"
922929
| "auto-submitted"
923930
| "chat-version"

0 commit comments

Comments
 (0)