Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat: Do not copy Auto-Submitted header into outer part
Before, copying Auto-Submitted to the outer headers was needed for moving such messages,
e.g. multi-device sync messages, to the DeltaChat folder. Now all encrypted messages are moved.
  • Loading branch information
iequidoo committed Nov 10, 2025
commit 267026b44ea0ad6dfa67d12ea01294f4e9fd9e1b
2 changes: 1 addition & 1 deletion src/mimefactory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ impl MimeFactory {
mail_builder::headers::raw::Raw::new("[...]").into(),
));
}
"in-reply-to" | "references" | "auto-submitted" | "autocrypt-setup-message" => {
"in-reply-to" | "references" | "autocrypt-setup-message" => {
unprotected_headers.push(header.clone());
}
_ => {
Expand Down
36 changes: 28 additions & 8 deletions src/securejoin/securejoin_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ async fn test_setup_contact_ex(case: SetupContactCase) {
bob.set_config(Config::Displayname, Some("Bob Examplenet"))
.await
.unwrap();
let alice_auto_submitted_hdr;
let alice_auto_submitted_val;
match case {
SetupContactCase::AliceIsBot => {
alice.set_config_bool(Config::Bot, true).await.unwrap();
alice_auto_submitted_hdr = "Auto-Submitted: auto-generated";
alice_auto_submitted_val = "auto-generated";
}
_ => alice_auto_submitted_hdr = "Auto-Submitted: auto-replied",
_ => alice_auto_submitted_val = "auto-replied",
};

assert_eq!(
Expand Down Expand Up @@ -121,14 +121,18 @@ async fn test_setup_contact_ex(case: SetupContactCase) {
);

let sent = alice.pop_sent_msg().await;
assert!(sent.payload.contains(alice_auto_submitted_hdr));
assert!(!sent.payload.contains("Auto-Submitted:"));
assert!(!sent.payload.contains("Alice Exampleorg"));
let msg = bob.parse_msg(&sent).await;
assert!(msg.was_encrypted());
assert_eq!(
msg.get_header(HeaderDef::SecureJoin).unwrap(),
"vc-auth-required"
);
assert_eq!(
msg.get_header(HeaderDef::AutoSubmitted).unwrap(),
alice_auto_submitted_val
);

let bob_chat = bob.get_chat(&alice).await;
assert_eq!(bob_chat.can_send(&bob).await.unwrap(), true);
Expand Down Expand Up @@ -157,7 +161,7 @@ async fn test_setup_contact_ex(case: SetupContactCase) {

// Check Bob sent the right message.
let sent = bob.pop_sent_msg().await;
assert!(sent.payload.contains("Auto-Submitted: auto-replied"));
assert!(!sent.payload.contains("Auto-Submitted:"));
assert!(!sent.payload.contains("Bob Examplenet"));
let mut msg = alice.parse_msg(&sent).await;
assert!(msg.was_encrypted());
Expand All @@ -171,6 +175,10 @@ async fn test_setup_contact_ex(case: SetupContactCase) {
msg.get_header(HeaderDef::SecureJoinFingerprint).unwrap(),
bob_fp
);
assert_eq!(
msg.get_header(HeaderDef::AutoSubmitted).unwrap(),
"auto-replied"
);

if case == SetupContactCase::WrongAliceGossip {
let wrong_pubkey = GossipedKey {
Expand Down Expand Up @@ -248,14 +256,18 @@ async fn test_setup_contact_ex(case: SetupContactCase) {

// Check Alice sent the right message to Bob.
let sent = alice.pop_sent_msg().await;
assert!(sent.payload.contains(alice_auto_submitted_hdr));
assert!(!sent.payload.contains("Auto-Submitted:"));
assert!(!sent.payload.contains("Alice Exampleorg"));
let msg = bob.parse_msg(&sent).await;
assert!(msg.was_encrypted());
assert_eq!(
msg.get_header(HeaderDef::SecureJoin).unwrap(),
"vc-contact-confirm"
);
assert_eq!(
msg.get_header(HeaderDef::AutoSubmitted).unwrap(),
alice_auto_submitted_val
);

// Bob has verified Alice already.
//
Expand Down Expand Up @@ -465,13 +477,17 @@ async fn test_secure_join() -> Result<()> {
alice.recv_msg_trash(&sent).await;

let sent = alice.pop_sent_msg().await;
assert!(sent.payload.contains("Auto-Submitted: auto-replied"));
assert!(!sent.payload.contains("Auto-Submitted:"));
let msg = bob.parse_msg(&sent).await;
assert!(msg.was_encrypted());
assert_eq!(
msg.get_header(HeaderDef::SecureJoin).unwrap(),
"vg-auth-required"
);
assert_eq!(
msg.get_header(HeaderDef::AutoSubmitted).unwrap(),
"auto-replied"
);

tcm.section("Step 4: Bob receives vg-auth-required, sends vg-request-with-auth");
bob.recv_msg_trash(&sent).await;
Expand Down Expand Up @@ -503,7 +519,7 @@ async fn test_secure_join() -> Result<()> {
}

// Check Bob sent the right handshake message.
assert!(sent.payload.contains("Auto-Submitted: auto-replied"));
assert!(!sent.payload.contains("Auto-Submitted:"));
let msg = alice.parse_msg(&sent).await;
assert!(msg.was_encrypted());
assert_eq!(
Expand All @@ -516,6 +532,10 @@ async fn test_secure_join() -> Result<()> {
msg.get_header(HeaderDef::SecureJoinFingerprint).unwrap(),
bob_fp
);
assert_eq!(
msg.get_header(HeaderDef::AutoSubmitted).unwrap(),
"auto-replied"
);

// Alice should not yet have Bob verified
let contact_bob = alice.add_or_lookup_contact_no_key(&bob).await;
Expand Down