mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
fix(mimefactory): do not wrap MDNs into multipart/mixed part
This commit is contained in:
@@ -768,6 +768,30 @@ impl<'a> MimeFactory<'a> {
|
|||||||
.build(),
|
.build(),
|
||||||
)
|
)
|
||||||
.header(("Subject".to_string(), "...".to_string()))
|
.header(("Subject".to_string(), "...".to_string()))
|
||||||
|
} else if matches!(self.loaded, Loaded::Mdn { .. }) {
|
||||||
|
// Never add outer multipart/mixed wrapper to MDN
|
||||||
|
// as multipart/report Content-Type is used to recognize MDNs
|
||||||
|
// by Delta Chat receiver and Chatmail servers
|
||||||
|
// allowing them to be unencrypted and not contain Autocrypt header
|
||||||
|
// without resetting Autocrypt encryption or triggering Chatmail filter
|
||||||
|
// that normally only allows encrypted mails.
|
||||||
|
|
||||||
|
// Hidden headers are dropped.
|
||||||
|
|
||||||
|
// Store protected headers in the outer message.
|
||||||
|
let message = headers
|
||||||
|
.protected
|
||||||
|
.iter()
|
||||||
|
.fold(message, |message, header| message.header(header.clone()));
|
||||||
|
|
||||||
|
let protected: HashSet<Header> = HashSet::from_iter(headers.protected.into_iter());
|
||||||
|
for h in headers.unprotected.split_off(0) {
|
||||||
|
if !protected.contains(&h) {
|
||||||
|
headers.unprotected.push(h);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
message
|
||||||
} else {
|
} else {
|
||||||
// Store hidden headers in the inner unencrypted message.
|
// Store hidden headers in the inner unencrypted message.
|
||||||
let message = headers
|
let message = headers
|
||||||
|
|||||||
Reference in New Issue
Block a user