feat: Don't send unencrypted Auto-Submitted header (#7938)

Cherry-picked 8c09ca3

Follow-up to https://github.com/chatmail/core/pull/7935
This commit is contained in:
Hocuri
2026-03-06 10:29:17 +01:00
committed by GitHub
parent abb93cd79d
commit 1e20055523
3 changed files with 9 additions and 15 deletions

View File

@@ -138,14 +138,15 @@ async fn test_setup_contact_ex(case: SetupContactCase) {
);
let sent = alice.pop_sent_msg().await;
assert_eq!(
sent.payload.contains("Auto-Submitted: auto-generated"),
alice_auto_submitted_hdr
);
assert_eq!(sent.payload.contains("Auto-Submitted:"), false);
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-pubkey");
assert_eq!(
msg.get_header(HeaderDef::AutoSubmitted),
alice_auto_submitted_hdr.then_some("auto-generated")
);
let bob_chat = bob.get_chat(&alice).await;
assert_eq!(bob_chat.can_send(&bob).await.unwrap(), true);
@@ -266,7 +267,7 @@ async fn test_setup_contact_ex(case: SetupContactCase) {
let sent = alice.pop_sent_msg().await;
assert_eq!(
sent.payload.contains("Auto-Submitted: auto-generated"),
alice_auto_submitted_hdr
false
);
assert!(!sent.payload.contains("Alice Exampleorg"));
let msg = bob.parse_msg(&sent).await;