set References header to Message-ID on top-level messages to add some resilience against smtp-server changing Message-ID header

This commit is contained in:
B. Petersen
2021-02-25 13:11:10 +01:00
committed by Hocuri
parent 98fc559536
commit f43555b41c

View File

@@ -1058,7 +1058,16 @@ impl Chat {
new_references = format!("{} {}", parent_in_reply_to, parent_rfc724_mid);
} else if !parent_in_reply_to.is_empty() {
new_references = parent_in_reply_to;
} else {
// as a fallback, use our Message-ID, see reasoning below.
new_references = new_rfc724_mid.clone();
}
} else {
// this is a top-level message, add our Message-ID as first reference.
// as we always try to extract the grpid also from `References:`-header,
// this allows group conversations also if smtp-server as outlook change `Message-ID:`-header
// (MUAs usually keep the first Message-ID in `References:`-header unchanged).
new_references = new_rfc724_mid.clone();
}
}