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:
epriestley
2011-02-09 17:39:55 -08:00
parent b7801c44fe
commit 193dbf16b4
10 changed files with 96 additions and 15 deletions

View File

@@ -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;
}

View 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();