File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -275,6 +275,18 @@ impl MimeMessage {
275
275
}
276
276
}
277
277
278
+ // Overwrite Message-ID with X-Microsoft-Original-Message-ID.
279
+ // However if we later find Message-ID in the protected part,
280
+ // it will overwrite both.
281
+ if let Some ( microsoft_message_id) =
282
+ headers. remove ( HeaderDef :: XMicrosoftOriginalMessageId . get_headername ( ) )
283
+ {
284
+ headers. insert (
285
+ HeaderDef :: MessageId . get_headername ( ) . to_string ( ) ,
286
+ microsoft_message_id,
287
+ ) ;
288
+ }
289
+
278
290
// Remove headers that are allowed _only_ in the encrypted+signed part. It's ok to leave
279
291
// them in signed-only emails, but has no value currently.
280
292
Self :: remove_secured_headers ( & mut headers) ;
@@ -1379,8 +1391,7 @@ impl MimeMessage {
1379
1391
}
1380
1392
1381
1393
pub ( crate ) fn get_rfc724_mid ( & self ) -> Option < String > {
1382
- self . get_header ( HeaderDef :: XMicrosoftOriginalMessageId )
1383
- . or_else ( || self . get_header ( HeaderDef :: MessageId ) )
1394
+ self . get_header ( HeaderDef :: MessageId )
1384
1395
. and_then ( |msgid| parse_message_id ( msgid) . ok ( ) )
1385
1396
}
1386
1397
You can’t perform that action at this time.
0 commit comments