Skip to content

Commit 5d28118

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 8c09ca3 commit 5d28118

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

deltachat-rpc-client/tests/test_something.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,6 @@ def test_download_limit_chat_assignment(acfactory, tmp_path, n_accounts):
667667
alice_group.send_text("hi")
668668
snapshot = bob.wait_for_incoming_msg().get_snapshot()
669669
assert snapshot.text == "hi"
670-
bob_group = snapshot.chat
671670

672671
path = tmp_path / "large"
673672
path.write_bytes(os.urandom(download_limit + 1))
@@ -677,15 +676,7 @@ def test_download_limit_chat_assignment(acfactory, tmp_path, n_accounts):
677676
alice_group.send_file(str(path))
678677
snapshot = bob.wait_for_incoming_msg().get_snapshot()
679678
assert snapshot.download_state == DownloadState.AVAILABLE
680-
if n_accounts > 2:
681-
assert snapshot.chat == bob_group
682-
else:
683-
# Group contains only Alice and Bob,
684-
# so partially downloaded messages are
685-
# hard to distinguish from private replies to group messages.
686-
#
687-
# Message may be a private reply, so we assign it to 1:1 chat with Alice.
688-
assert snapshot.chat == bob_chat_alice
679+
assert snapshot.chat == bob_chat_alice
689680

690681

691682
def test_markseen_contact_request(acfactory):

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)