1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

Stop moving "Cc" addresses to "To" when building mail targets

Summary: Fixes T10539. When building mail targets, we fail to preserve whether a recipient was originally "To" or "Cc", and just move everyone to "To".

Test Plan:
Added a comment to a task with a "To" user and a "Cc" user, with `metamta.placeholder-to-recipient` set and `metamta.one-mail-per-recipient` set.

Got mail with me Cc'd as the Cc'd user:

{F1172020}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10539

Differential Revision: https://secure.phabricator.com/D15465
This commit is contained in:
epriestley 2016-03-11 16:02:19 -08:00
parent de23ba0002
commit ba9cd64e51

View file

@ -254,10 +254,19 @@ abstract class PhabricatorMailReplyHandler extends Phobject {
$map = $to + $cc; $map = $to + $cc;
foreach ($map as $phid => $user) { foreach ($map as $phid => $user) {
// Preserve the original To/Cc information on the target.
if (isset($to[$phid])) {
$target_to = array($phid => $user);
$target_cc = array();
} else {
$target_to = array();
$target_cc = array($phid => $user);
}
$target = id(clone $template) $target = id(clone $template)
->setViewer($user) ->setViewer($user)
->setToMap(array($phid => $user)) ->setToMap($target_to)
->setCCMap(array()); ->setCCMap($target_cc);
if ($supports_private_replies) { if ($supports_private_replies) {
$reply_to = $this->getPrivateReplyHandlerEmailAddress($user); $reply_to = $this->getPrivateReplyHandlerEmailAddress($user);