1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-19 16:58:48 +02:00

Fix a small inbound email glitch

Summary:
Sendmail isn't actually OK with passing ENV stuff via 'aliases', accept it as an
argument instead.

Test Plan:
Sent real email to a real server, got differential updates!

Reviewed By: jungejason
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, jungejason
Differential Revision: 233
This commit is contained in:
epriestley 2011-05-05 15:11:36 -07:00
parent 25dee6ecd2
commit 80eb0f0eb1
3 changed files with 8 additions and 2 deletions

View file

@ -21,7 +21,9 @@ ini_set('include_path', $include_path.':'.dirname(__FILE__).'/../../');
require_once dirname(dirname(__FILE__)).'/conf/__init_conf__.php';
$env = getenv('PHABRICATOR_ENV');
$env = isset($_SERVER['PHABRICATOR_ENV'])
? $_SERVER['PHABRICATOR_ENV']
: getenv('PHABRICATOR_ENV');
if (!$env) {
echo "Define PHABRICATOR_ENV before running this script.\n";
exit(1);

View file

@ -17,6 +17,10 @@
* limitations under the License.
*/
if ($argc > 1) {
$_SERVER['PHABRICATOR_ENV'] = $argv[1];
}
$root = dirname(dirname(dirname(__FILE__)));
require_once $root.'/scripts/__init_script__.php';
require_once $root.'/scripts/__init_env__.php';

View file

@ -47,7 +47,7 @@ probably means something like this:
Now, you can actually configure sendmail to deliver to Phabricator. In
##/etc/aliases##, add an entry like this:
phabricator: "| PHABRICATOR_ENV=<ENV> /path/to/phabricator/scripts/mail/mail_handler.php"
phabricator: "| /path/to/phabricator/scripts/mail/mail_handler.php <ENV>"
...where <ENV> is the PHABRICATOR_ENV the script should run under. Run
##sudo newaliases##. Now you likely need to symlink this script into