File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -768,6 +768,30 @@ impl<'a> MimeFactory<'a> {
768
768
. build ( ) ,
769
769
)
770
770
. header ( ( "Subject" . to_string ( ) , "..." . to_string ( ) ) )
771
+ } else if matches ! ( self . loaded, Loaded :: Mdn { .. } ) {
772
+ // Never add outer multipart/mixed wrapper to MDN
773
+ // as multipart/report Content-Type is used to recognize MDNs
774
+ // by Delta Chat receiver and Chatmail servers
775
+ // allowing them to be unencrypted and not contain Autocrypt header
776
+ // without resetting Autocrypt encryption or triggering Chatmail filter
777
+ // that normally only allows encrypted mails.
778
+
779
+ // Hidden headers are dropped.
780
+
781
+ // Store protected headers in the outer message.
782
+ let message = headers
783
+ . protected
784
+ . iter ( )
785
+ . fold ( message, |message, header| message. header ( header. clone ( ) ) ) ;
786
+
787
+ let protected: HashSet < Header > = HashSet :: from_iter ( headers. protected . into_iter ( ) ) ;
788
+ for h in headers. unprotected . split_off ( 0 ) {
789
+ if !protected. contains ( & h) {
790
+ headers. unprotected . push ( h) ;
791
+ }
792
+ }
793
+
794
+ message
771
795
} else {
772
796
// Store hidden headers in the inner unencrypted message.
773
797
let message = headers
You can’t perform that action at this time.
0 commit comments