From e4deb7faada9b185466df4aa102e0ae28c52ca27 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 14 Jan 2014 13:22:47 -0800 Subject: [PATCH] Remove `metamta.send-immediately` Summary: Ref T3857. - Always send mail via daemons. This lets us get rid of this config, and is generally much more performant. - After D7964, we warn if daemons aren't running. Test Plan: Sent some mail. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T3857 Differential Revision: https://secure.phabricator.com/D7965 --- conf/default.conf.php | 7 ------- .../check/PhabricatorSetupCheckExtraConfig.php | 2 ++ .../option/PhabricatorMetaMTAConfigOptions.php | 17 ----------------- .../metamta/storage/PhabricatorMetaMTAMail.php | 18 +++--------------- .../configuring_outbound_email.diviner | 11 ----------- 5 files changed, 5 insertions(+), 50 deletions(-) diff --git a/conf/default.conf.php b/conf/default.conf.php index e7e64829ac..8b31f89792 100644 --- a/conf/default.conf.php +++ b/conf/default.conf.php @@ -299,13 +299,6 @@ return array( 'metamta.mail-adapter' => 'PhabricatorMailImplementationPHPMailerLiteAdapter', - // When email is sent, try to hand it off to the MTA immediately instead of - // queueing it for delivery by the daemons. If you are running the Phabricator - // daemons with "phd start", you should disable this to provide a (sometimes - // substantial) performance boost. It's on by default to make setup and - // configuration a little easier. - 'metamta.send-immediately' => true, - // When email is sent, what format should Phabricator use for user's // email addresses? Valid values are: // - 'short' - 'gwashington ' diff --git a/src/applications/config/check/PhabricatorSetupCheckExtraConfig.php b/src/applications/config/check/PhabricatorSetupCheckExtraConfig.php index 5e135c080f..eb1cfc0027 100644 --- a/src/applications/config/check/PhabricatorSetupCheckExtraConfig.php +++ b/src/applications/config/check/PhabricatorSetupCheckExtraConfig.php @@ -170,6 +170,8 @@ final class PhabricatorSetupCheckExtraConfig extends PhabricatorSetupCheck { 'celerity.resource-path' => pht( 'An alternate resource map is no longer supported. Instead, use '. 'multiple maps. See T4222.'), + 'metamta.send-immediately' => pht( + 'Mail is now always delivered by the daemons.'), ); return $ancient_config; diff --git a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php index afd7738e27..18ae3d27c5 100644 --- a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php +++ b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php @@ -136,15 +136,6 @@ great. A number of other mailers are available (e.g., SES, SendGrid, SMTP, custom mailers), consult "Configuring Outbound Email" in the documentation for details. EODOC -)); - - $immediately_description = $this->deformat(pht(<<deformat(pht(<<setSummary(pht('Trust "Reply-To" headers for authentication.')) ->setDescription($reply_to_description), - $this->newOption('metamta.send-immediately', 'bool', true) - ->setBoolOptions( - array( - pht('Send Immediately (Slow)'), - pht('Send Via Daemons (Must Run Daemons)'), - )) - ->setSummary(pht('Improve performance by sending email via daemons.')) - ->setDescription($immediately_description), $this->newOption('metamta.placeholder-to-recipient', 'string', null) ->setSummary(pht('Placeholder for mail with only CCs.')) ->setDescription($placeholder_description), diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php index a6c2e1e08f..ec01faf9a2 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -289,25 +289,13 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO { } /** - * Save a newly created mail to the database and attempt to send it - * immediately if the server is configured for immediate sends. When - * applications generate new mail they should generally use this method to - * deliver it. If the server doesn't use immediate sends, this has the same - * effect as calling save(): the mail will eventually be delivered by the - * MetaMTA daemon. + * Save a newly created mail to the database. The mail will eventually be + * delivered by the MetaMTA daemon. * * @return this */ public function saveAndSend() { - $ret = null; - - if (PhabricatorEnv::getEnvConfig('metamta.send-immediately')) { - $ret = $this->sendNow(); - } else { - $ret = $this->save(); - } - - return $ret; + return $this->save(); } protected function didWriteData() { diff --git a/src/docs/user/configuration/configuring_outbound_email.diviner b/src/docs/user/configuration/configuring_outbound_email.diviner index 56a08eb006..7489ef645e 100644 --- a/src/docs/user/configuration/configuring_outbound_email.diviner +++ b/src/docs/user/configuration/configuring_outbound_email.diviner @@ -152,17 +152,6 @@ disable outbound mail, if you don't want to send mail or don't want to configure it yet. Just set **metamta.mail-adapter** to "PhabricatorMailImplementationTestAdapter". -= Configuring MetaMTA to Send Mail Using a Daemon = - -Regardless of how you are sending outbound email, you can move the handoff to -the MTA out of the main process and into a daemon. This will greatly improve -application performance if your mailer is slow, like Amazon SES. In particular, -commenting on Differential Revisions and Maniphest Tasks sends outbound email. - -If you set **metamta.send-immediately** to ##false## in your configuration, -MetaMTA will queue mail to be send by a PhabricatorTaskmasterDaemon. -For more information on using daemons, see @{article:Managing Daemons with phd}. - = Testing and Debugging Outbound Email = You can use the `bin/mail` utility to test, debug, and examine outbound mail. In