1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42: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',
// 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

@ -114,6 +114,21 @@ class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
$this->setParam('simulated-failures', $count);
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(
$force_send = false,