Skip to content

Commit 64bbcfc

Browse files
committed
feat: protect the Date header
1 parent ff08b9e commit 64bbcfc

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

@@ -915,8 +923,7 @@ impl MimeFactory {
915923
mail_builder::headers::raw::Raw::new("[...]").into(),
916924
));
917925
}
918-
"date"
919-
| "in-reply-to"
926+
"in-reply-to"
920927
| "references"
921928
| "auto-submitted"
922929
| "chat-version"

0 commit comments

Comments
 (0)