From 9de54aedb57801fcee9f9da839cf730063f98ca7 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 5 Feb 2018 10:37:39 -0800 Subject: [PATCH] Remove inconsistent and confusing use of the term "multiplex" in mail Summary: Ref T13053. Because I previously misunderstood what "multiplex" means, I used it in various contradictory and inconsistent ways. We can send mail in two ways: either one mail to everyone with a big "To" and a big "Cc" (not default; better for mailing lists) or one mail to each recipient with just them in "To" (default; better for almost everything else). "Multiplexing" is combining multiple signals over a single channel, so it more accurately describes the big to/cc. However, it is sometimes used to descibe the other approach. Since it's ambiguous and I've tainted it through misuse, get rid of it and use more clear language. (There's still some likely misuse in the SMS stuff, and a couple of legitimate uses in other contexts.) Test Plan: Grepped for `multiplex`, saw less of it. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13053 Differential Revision: https://secure.phabricator.com/D18994 --- .../config/option/PhabricatorMetaMTAConfigOptions.php | 6 +++--- .../PhabricatorMailImplementationPHPMailerAdapter.php | 4 ++-- .../PhabricatorMailImplementationPHPMailerLiteAdapter.php | 4 ++-- .../metamta/storage/PhabricatorMetaMTAMail.php | 8 ++++---- .../panel/PhabricatorEmailFormatSettingsPanel.php | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php index 6c846daa57..8c2d2265bc 100644 --- a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php +++ b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php @@ -153,9 +153,9 @@ EODOC $adapter_doc_name)); $placeholder_description = $this->deformat(pht(<<mailer->Encoding = $encoding; // By default, PHPMailer sends one mail per recipient. We handle - // multiplexing higher in the stack, so tell it to send mail exactly - // like we ask. + // combining or separating To and Cc higher in the stack, so tell it to + // send mail exactly like we ask. $this->mailer->SingleTo = false; $mailer = PhabricatorEnv::getEnvConfig('phpmailer.mailer'); diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php index f072e769c3..668f9353ec 100644 --- a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php +++ b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php @@ -22,8 +22,8 @@ class PhabricatorMailImplementationPHPMailerLiteAdapter $this->mailer->Encoding = $encoding; // By default, PHPMailerLite sends one mail per recipient. We handle - // multiplexing higher in the stack, so tell it to send mail exactly - // like we ask. + // combining or separating To and Cc higher in the stack, so tell it to + // send mail exactly like we ask. $this->mailer->SingleTo = false; } diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php index a7734b7ae8..f19e5e951a 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -507,8 +507,8 @@ final class PhabricatorMetaMTAMail $add_cc = array(); $add_to = array(); - // If multiplexing is enabled, some recipients will be in "Cc" - // rather than "To". We'll move them to "To" later (or supply a + // If we're sending one mail to everyone, some recipients will be in + // "Cc" rather than "To". We'll move them to "To" later (or supply a // dummy "To") but need to look for the recipient in either the // "To" or "Cc" fields here. $target_phid = head(idx($params, 'to', array())); @@ -847,7 +847,7 @@ final class PhabricatorMetaMTAMail return base64_encode($base); } - public static function shouldMultiplexAllMail() { + public static function shouldMailEachRecipient() { return PhabricatorEnv::getEnvConfig('metamta.one-mail-per-recipient'); } @@ -1290,7 +1290,7 @@ final class PhabricatorMetaMTAMail private function loadPreferences($target_phid) { $viewer = PhabricatorUser::getOmnipotentUser(); - if (self::shouldMultiplexAllMail()) { + if (self::shouldMailEachRecipient()) { $preferences = id(new PhabricatorUserPreferencesQuery()) ->setViewer($viewer) ->withUserPHIDs(array($target_phid)) diff --git a/src/applications/settings/panel/PhabricatorEmailFormatSettingsPanel.php b/src/applications/settings/panel/PhabricatorEmailFormatSettingsPanel.php index 107816f2eb..bdc3c994b3 100644 --- a/src/applications/settings/panel/PhabricatorEmailFormatSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorEmailFormatSettingsPanel.php @@ -14,7 +14,7 @@ final class PhabricatorEmailFormatSettingsPanel } public function isUserPanel() { - return PhabricatorMetaMTAMail::shouldMultiplexAllMail(); + return PhabricatorMetaMTAMail::shouldMailEachRecipient(); } public function isManagementPanel() {