Skip to content

Commit 78aa725

Browse files
committed
feat: protect the Date header
1 parent df0ac1d commit 78aa725

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

@@ -917,8 +925,7 @@ impl MimeFactory {
917925
mail_builder::headers::raw::Raw::new("[...]").into(),
918926
));
919927
}
920-
"date"
921-
| "in-reply-to"
928+
"in-reply-to"
922929
| "references"
923930
| "auto-submitted"
924931
| "chat-version"

0 commit comments

Comments
 (0)