mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
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
This commit is contained in:
parent
f060d8eb8f
commit
e4deb7faad
5 changed files with 5 additions and 50 deletions
|
@ -299,13 +299,6 @@ return array(
|
||||||
'metamta.mail-adapter' =>
|
'metamta.mail-adapter' =>
|
||||||
'PhabricatorMailImplementationPHPMailerLiteAdapter',
|
'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
|
// When email is sent, what format should Phabricator use for user's
|
||||||
// email addresses? Valid values are:
|
// email addresses? Valid values are:
|
||||||
// - 'short' - 'gwashington <gwashington@example.com>'
|
// - 'short' - 'gwashington <gwashington@example.com>'
|
||||||
|
|
|
@ -170,6 +170,8 @@ final class PhabricatorSetupCheckExtraConfig extends PhabricatorSetupCheck {
|
||||||
'celerity.resource-path' => pht(
|
'celerity.resource-path' => pht(
|
||||||
'An alternate resource map is no longer supported. Instead, use '.
|
'An alternate resource map is no longer supported. Instead, use '.
|
||||||
'multiple maps. See T4222.'),
|
'multiple maps. See T4222.'),
|
||||||
|
'metamta.send-immediately' => pht(
|
||||||
|
'Mail is now always delivered by the daemons.'),
|
||||||
);
|
);
|
||||||
|
|
||||||
return $ancient_config;
|
return $ancient_config;
|
||||||
|
|
|
@ -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
|
custom mailers), consult "Configuring Outbound Email" in the documentation for
|
||||||
details.
|
details.
|
||||||
EODOC
|
EODOC
|
||||||
));
|
|
||||||
|
|
||||||
$immediately_description = $this->deformat(pht(<<<EODOC
|
|
||||||
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.
|
|
||||||
EODOC
|
|
||||||
));
|
));
|
||||||
|
|
||||||
$placeholder_description = $this->deformat(pht(<<<EODOC
|
$placeholder_description = $this->deformat(pht(<<<EODOC
|
||||||
|
@ -298,14 +289,6 @@ EODOC
|
||||||
))
|
))
|
||||||
->setSummary(pht('Trust "Reply-To" headers for authentication.'))
|
->setSummary(pht('Trust "Reply-To" headers for authentication.'))
|
||||||
->setDescription($reply_to_description),
|
->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)
|
$this->newOption('metamta.placeholder-to-recipient', 'string', null)
|
||||||
->setSummary(pht('Placeholder for mail with only CCs.'))
|
->setSummary(pht('Placeholder for mail with only CCs.'))
|
||||||
->setDescription($placeholder_description),
|
->setDescription($placeholder_description),
|
||||||
|
|
|
@ -289,25 +289,13 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save a newly created mail to the database and attempt to send it
|
* Save a newly created mail to the database. The mail will eventually be
|
||||||
* immediately if the server is configured for immediate sends. When
|
* delivered by the MetaMTA daemon.
|
||||||
* 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.
|
|
||||||
*
|
*
|
||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
public function saveAndSend() {
|
public function saveAndSend() {
|
||||||
$ret = null;
|
return $this->save();
|
||||||
|
|
||||||
if (PhabricatorEnv::getEnvConfig('metamta.send-immediately')) {
|
|
||||||
$ret = $this->sendNow();
|
|
||||||
} else {
|
|
||||||
$ret = $this->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function didWriteData() {
|
protected function didWriteData() {
|
||||||
|
|
|
@ -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
|
it yet. Just set **metamta.mail-adapter** to
|
||||||
"PhabricatorMailImplementationTestAdapter".
|
"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 =
|
= Testing and Debugging Outbound Email =
|
||||||
|
|
||||||
You can use the `bin/mail` utility to test, debug, and examine outbound mail. In
|
You can use the `bin/mail` utility to test, debug, and examine outbound mail. In
|
||||||
|
|
Loading…
Reference in a new issue