1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Add a default-send behavior to MetaMTA.

This commit is contained in:
epriestley 2011-01-31 21:13:38 -08:00
parent 233953bc4a
commit 4faad5b3f1
3 changed files with 24 additions and 0 deletions

View file

@ -66,6 +66,12 @@ return array(
'user.default-profile-image-phid' => 'PHID-FILE-f57aaefce707fc4060ef', 'user.default-profile-image-phid' => 'PHID-FILE-f57aaefce707fc4060ef',
// When email is sent, try to hand it off to the MTA immediately. The only
// reason to disable this is if your MTA infrastructure is completely
// terrible. If you disable this option, you must run the 'metamta_mta.php'
// daemon or mail won't be handed off to the MTA.
'metamta.send-immediately' => true,
); );

View file

@ -0,0 +1,3 @@
<?php
// Placeholder so I don't forget about this, hopefully.

View file

@ -115,6 +115,21 @@ class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
return $this; return $this;
} }
public function save() {
$try_send = (PhabricatorEnv::getEnvConfig('metamta.send-immediately')) &&
(!$this->getID());
$ret = parent::save();
if ($try_send) {
$mailer = new PhabricatorMailImplementationPHPMailerLiteAdapter();
$this->sendNow($force_send = false, $mailer);
}
return $ret;
}
public function sendNow( public function sendNow(
$force_send = false, $force_send = false,
PhabricatorMailImplementationAdapter $mailer) { PhabricatorMailImplementationAdapter $mailer) {