Very basic daemon infrastructure, plus MetaMTA daemon.
Summary: Amazon SES seems to be working well, except that it takes more than a second to send mail in-process. Kick it out of process. (Between this and the ImplementationAdapter layer, MetaMTA almost makes sense. :/) Test Plan: Ran the daemon and got a flood of unsent test email. Reviewers: CC:
This commit is contained in:
@@ -30,3 +30,12 @@ if (!ini_get('date.timezone')) {
|
||||
}
|
||||
|
||||
phutil_load_library(dirname(__FILE__).'/../src/');
|
||||
|
||||
function phabricator_read_config_file($config) {
|
||||
$root = dirname(dirname(__FILE__));
|
||||
$conf = include $root.'/conf/'.$config.'.conf.php';
|
||||
if ($conf === false) {
|
||||
throw new Exception("Failed to read config file '{$config}'.");
|
||||
}
|
||||
return $conf;
|
||||
}
|
||||
|
||||
21
scripts/daemons/metamta/metamta_mta.php → scripts/daemon/run_daemon.php
Normal file → Executable file
21
scripts/daemons/metamta/metamta_mta.php → scripts/daemon/run_daemon.php
Normal file → Executable file
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/*
|
||||
@@ -16,4 +17,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// Placeholder so I don't forget about this, hopefully.
|
||||
$root = dirname(dirname(dirname(__FILE__)));
|
||||
require_once $root.'/scripts/__init_script__.php';
|
||||
|
||||
$env = getenv('PHABRICATOR_ENV');
|
||||
if (!$env) {
|
||||
echo "Define PHABRICATOR_ENV before running scripts.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$conf = phabricator_read_config_file($env);
|
||||
$conf['phabricator.env'] = $env;
|
||||
|
||||
phutil_require_module('phabricator', 'infrastructure/env');
|
||||
PhabricatorEnv::setEnvConfig($conf);
|
||||
phutil_require_module('phutil', 'symbols');
|
||||
|
||||
PhutilSymbolLoader::loadClass('PhabricatorMetaMTADaemon');
|
||||
$daemon = new PhabricatorMetaMTADaemon();
|
||||
$daemon->run();
|
||||
Reference in New Issue
Block a user