@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix verbose email addresses being passed to mail adapters

Summary:
Fixes T5233.

- The mail adapter API currently expects plain addresses (like `a@b.com`) in `addTos()`, and some adapters can not accept fancy verbose addresses (like `"name" <a@b.com>`).
- When we try to send error email, we pass the entire "From" header into the API. This is incorrect.
- Since it would be nice to make this just work in the future, fix it inside the API.
- Specifically, this is reached with: send email -> generates error -> we try to send you an email back -> we send it to your "From" -> some mailers choke on the fancy name if you have one.

Test Plan: Processed an errorneous email with a fancy "From", got a response error.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5233

Differential Revision: https://secure.phabricator.com/D10232

+9
+9
src/applications/metamta/storage/PhabricatorMetaMTAMail.php
··· 96 96 } 97 97 98 98 public function addRawTos(array $raw_email) { 99 + 100 + // Strip addresses down to bare emails, since the MailAdapter API currently 101 + // requires we pass it just the address (like `alincoln@logcabin.org`), not 102 + // a full string like `"Abraham Lincoln" <alincoln@logcabin.org>`. 103 + foreach ($raw_email as $key => $email) { 104 + $object = new PhutilEmailAddress($email); 105 + $raw_email[$key] = $object->getAddress(); 106 + } 107 + 99 108 $this->setParam('raw-to', $raw_email); 100 109 return $this; 101 110 }