Skip to content

Commit 985aef5

Browse files
committed
feat: Don't copy References and In-Reply-To to outer headers
This implements the suggestion from https://www.rfc-editor.org/rfc/rfc9788.html#name-offering-more-ambitious-hea of "Header Protection for Cryptographically Protected Email".
1 parent a91a62b commit 985aef5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/mimefactory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ impl MimeFactory {
10621062
mail_builder::headers::raw::Raw::new("[...]").into(),
10631063
));
10641064
}
1065-
"in-reply-to" | "references" | "autocrypt-setup-message" => {
1065+
"autocrypt-setup-message" => {
10661066
unprotected_headers.push(header.clone());
10671067
}
10681068
_ => {

src/receive_imf/receive_imf_tests.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4849,14 +4849,15 @@ async fn test_prefer_references_to_downloaded_msgs() -> Result<()> {
48494849
let received = bob.recv_msg(&sent).await;
48504850
assert_eq!(received.download_state, DownloadState::Available);
48514851
assert_ne!(received.chat_id, bob_chat_id);
4852-
assert_eq!(received.chat_id, bob.get_chat(alice).await.id);
4852+
let bob_alice_chat_id = bob.get_chat(alice).await.id;
4853+
assert_eq!(received.chat_id, bob_alice_chat_id);
48534854

48544855
let mut msg = Message::new(Viewtype::File);
48554856
msg.set_file_from_bytes(alice, "file", file_bytes, None)?;
48564857
let sent = alice.send_msg(alice_chat_id, &mut msg).await;
48574858
let received = bob.recv_msg(&sent).await;
48584859
assert_eq!(received.download_state, DownloadState::Available);
4859-
assert_eq!(received.chat_id, bob_chat_id);
4860+
assert_eq!(received.chat_id, bob_alice_chat_id);
48604861

48614862
Ok(())
48624863
}

0 commit comments

Comments
 (0)