mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
Set X-Microsoft-Original-Message-ID on outgoing emails for amazonaws (#3077)
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
and remove update-id from `DC_EVENT_WEBXDC_STATUS_UPDATE` #3081
|
and remove update-id from `DC_EVENT_WEBXDC_STATUS_UPDATE` #3081
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
- Hopefully fix a bug where outgoing messages appear twice with Amazon SES #3077
|
||||||
- do not delete messages without Message-IDs as duplicates #3095
|
- do not delete messages without Message-IDs as duplicates #3095
|
||||||
- Assign replies from a different email address to the correct chat #3119
|
- Assign replies from a different email address to the correct chat #3119
|
||||||
- start ephemeral timer when seen status is synchronized via IMAP #3122
|
- start ephemeral timer when seen status is synchronized via IMAP #3122
|
||||||
|
|||||||
@@ -544,10 +544,25 @@ impl<'a> MimeFactory<'a> {
|
|||||||
Loaded::Message { .. } => self.msg.rfc724_mid.clone(),
|
Loaded::Message { .. } => self.msg.rfc724_mid.clone(),
|
||||||
Loaded::Mdn { .. } => dc_create_outgoing_rfc724_mid(None, &self.from_addr),
|
Loaded::Mdn { .. } => dc_create_outgoing_rfc724_mid(None, &self.from_addr),
|
||||||
};
|
};
|
||||||
|
let rfc724_mid_headervalue = render_rfc724_mid(&rfc724_mid);
|
||||||
|
|
||||||
|
// Amazon's SMTP servers change the `Message-ID`, just as Outlook's SMTP servers do.
|
||||||
|
// Outlook's servers add an `X-Microsoft-Original-Message-ID` header with the original `Message-ID`,
|
||||||
|
// and when downloading messages we look for this header in order to correctly identify
|
||||||
|
// messages.
|
||||||
|
// Amazon's servers do not add such a header, so we just add it ourselves.
|
||||||
|
if let Some(server) = context.get_config(Config::ConfiguredSendServer).await? {
|
||||||
|
if server.ends_with(".amazonaws.com") {
|
||||||
headers.unprotected.push(Header::new(
|
headers.unprotected.push(Header::new(
|
||||||
"Message-ID".into(),
|
"X-Microsoft-Original-Message-ID".into(),
|
||||||
render_rfc724_mid(&rfc724_mid),
|
rfc724_mid_headervalue.clone(),
|
||||||
));
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
headers
|
||||||
|
.unprotected
|
||||||
|
.push(Header::new("Message-ID".into(), rfc724_mid_headervalue));
|
||||||
|
|
||||||
// Reply headers as in <https://datatracker.ietf.org/doc/html/rfc5322#appendix-A.2>.
|
// Reply headers as in <https://datatracker.ietf.org/doc/html/rfc5322#appendix-A.2>.
|
||||||
if !self.in_reply_to.is_empty() {
|
if !self.in_reply_to.is_empty() {
|
||||||
|
|||||||
Reference in New Issue
Block a user