1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 01:10:58 +01:00

Fix Mailgun Reply-To handling

Summary:
When sending the "Reply-To" header to Mailgun, Phabricator would
previously send two headers for every "Reply-To": "Reply-To[0][email]" and
"Reply-To[0][name]". Instead, explicitly build the header as specified by RFC
2822 and send it to Mailgun pre-baked.

Pretty sure this bug was a cargo-cult from the Sendgrid code, where (apparently)
this actually works.

Test Plan:
Triggered an email from Phabricator, saw that the header was sent
properly.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D8645
This commit is contained in:
Carl Jackson 2014-03-29 10:52:56 -07:00 committed by epriestley
parent cca5078d9f
commit 213eea7bdd

View file

@ -18,10 +18,7 @@ final class PhabricatorMailImplementationMailgunAdapter
if (empty($this->params['reply-to'])) {
$this->params['reply-to'] = array();
}
$this->params['reply-to'][] = array(
'email' => $email,
'name' => $name,
);
$this->params['reply-to'][] = "{$name} <{$email}>";
return $this;
}
@ -92,7 +89,7 @@ final class PhabricatorMailImplementationMailgunAdapter
if (idx($this->params, 'reply-to')) {
$replyto = $this->params['reply-to'];
$params['h:reply-to'] = $replyto;
$params['h:reply-to'] = implode(', ', $replyto);
}
if (idx($this->params, 'ccs')) {