Include both the Gmail and "natural" Message-IDs in the "References" header
Summary: See T251, where gregprice correctly argues that we need both: None of the other people on the thread will have seen that message, so it seems like a lot of clients would put the server's message in a new thread. In general, I think you want the References: header to mention every ancestor message in the thread that you know about, because that's how MUAs keep a thread together in the face of missing some of its messages. Test Plan: Sent a reply email locally, got a response with both Message-IDs in "references". Reviewed By: rm Reviewers: gregprice, rm Commenters: gregprice CC: aran, gregprice, epriestley, rm Differential Revision: 499
This commit is contained in:
@@ -298,12 +298,17 @@ class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
|||||||
$mailer->addHeader('Message-ID', $value);
|
$mailer->addHeader('Message-ID', $value);
|
||||||
} else {
|
} else {
|
||||||
$in_reply_to = $value;
|
$in_reply_to = $value;
|
||||||
|
$references = array($value);
|
||||||
$parent_id = $this->getParentMessageID();
|
$parent_id = $this->getParentMessageID();
|
||||||
if ($parent_id) {
|
if ($parent_id) {
|
||||||
$in_reply_to = $parent_id;
|
$in_reply_to = $parent_id;
|
||||||
|
// By RFC 2822, the most immediate parent should appear last
|
||||||
|
// in the "References" header, so this order is intentional.
|
||||||
|
$references[] = $parent_id;
|
||||||
}
|
}
|
||||||
|
$references = implode(' ', $references);
|
||||||
$mailer->addHeader('In-Reply-To', $in_reply_to);
|
$mailer->addHeader('In-Reply-To', $in_reply_to);
|
||||||
$mailer->addHeader('References', $in_reply_to);
|
$mailer->addHeader('References', $references);
|
||||||
}
|
}
|
||||||
$thread_index = $this->generateThreadIndex($value, $is_first);
|
$thread_index = $this->generateThreadIndex($value, $is_first);
|
||||||
$mailer->addHeader('Thread-Index', $thread_index);
|
$mailer->addHeader('Thread-Index', $thread_index);
|
||||||
|
|||||||
Reference in New Issue
Block a user