diff --git a/src/chat/chat_tests.rs b/src/chat/chat_tests.rs index ba13e3e4b0..ae033c2b0a 100644 --- a/src/chat/chat_tests.rs +++ b/src/chat/chat_tests.rs @@ -790,15 +790,6 @@ async fn test_self_talk() -> Result<()> { assert!(msg.get_showpadlock()); let sent_msg = t.pop_sent_msg().await; - let payload = sent_msg.payload(); - // Make sure the `To` field contains the address and not - // "undisclosed recipients". - // Otherwise Delta Chat core <1.153.0 assigns the message - // to the trash chat. - assert_eq!( - payload.match_indices("To: \r\n").count(), - 1 - ); let t2 = TestContext::new_alice().await; t2.recv_msg(&sent_msg).await; diff --git a/src/mimefactory.rs b/src/mimefactory.rs index af3596c052..ae39de889e 100644 --- a/src/mimefactory.rs +++ b/src/mimefactory.rs @@ -8,7 +8,7 @@ use anyhow::{bail, Context as _, Result}; use base64::Engine as _; use chrono::TimeZone; use deltachat_contact_tools::sanitize_bidi_characters; -use mail_builder::headers::address::{Address, EmailAddress}; +use mail_builder::headers::address::Address; use mail_builder::headers::HeaderType; use mail_builder::mime::MimePart; use tokio::fs; @@ -850,24 +850,7 @@ impl MimeFactory { } else if header_name == "to" { protected_headers.push(header.clone()); if is_encrypted { - let mut to_without_names = to - .clone() - .into_iter() - .filter_map(|header| match header { - Address::Address(mb) => Some(Address::Address(EmailAddress { - name: None, - email: mb.email, - })), - _ => None, - }) - .collect::>(); - if to_without_names.is_empty() { - to_without_names.push(hidden_recipients()); - } - unprotected_headers.push(( - original_header_name, - Address::new_list(to_without_names).into(), - )); + unprotected_headers.push(("To", hidden_recipients().into())); } else { unprotected_headers.push(header.clone()); }