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

don't add email addresses to CC if they are already in TO

Summary:
Some mailers remove the duplicate entries themselves, but some (Mailgun) don't.
This affects installations with metamta.one-mail-per-recipient set to false, and will cause
- ugly looking "to" entries. Gmail, for example, collapses to+cc entries to one list, so you get something that looks like "to: me me john"
- It sometimes causes duplicate delivery of the same message when used in conjuction with Google Groups. I suspect that their message de-dup mechanism is confused by it (I fuzzed it directly with Mailgun, and saw the same message delivered twice - once directly through mailgun, and bounced again through Google Groups). This doesn't happen when the entries are not duplicated.

Test Plan: Created some tasks. Added subscribers. Things seem to work reasonably well.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9978
This commit is contained in:
Tal Shiri 2014-07-17 18:32:44 -07:00 committed by epriestley
parent bd3c239d5a
commit 570a78d42a

View file

@ -606,7 +606,7 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
} }
$add_to = array_unique($add_to); $add_to = array_unique($add_to);
$add_cc = array_unique($add_cc); $add_cc = array_diff(array_unique($add_cc), $add_to);
$mailer->addTos($add_to); $mailer->addTos($add_to);
if ($add_cc) { if ($add_cc) {