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:
parent
233953bc4a
commit
4faad5b3f1
3 changed files with 24 additions and 0 deletions
|
@ -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,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
3
scripts/daemons/metamta/metamta_mta.php
Normal file
3
scripts/daemons/metamta/metamta_mta.php
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Placeholder so I don't forget about this, hopefully.
|
|
@ -114,6 +114,21 @@ class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
||||||
$this->setParam('simulated-failures', $count);
|
$this->setParam('simulated-failures', $count);
|
||||||
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,
|
||||||
|
|
Loading…
Reference in a new issue