diff --git a/conf/default.conf.php b/conf/default.conf.php index 9003515814..ee9cbf31bb 100644 --- a/conf/default.conf.php +++ b/conf/default.conf.php @@ -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, + ); diff --git a/scripts/daemons/metamta/metamta_mta.php b/scripts/daemons/metamta/metamta_mta.php new file mode 100644 index 0000000000..e3906efd34 --- /dev/null +++ b/scripts/daemons/metamta/metamta_mta.php @@ -0,0 +1,3 @@ +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,