mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01: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:
parent
25dee6ecd2
commit
80eb0f0eb1
3 changed files with 8 additions and 2 deletions
|
@ -21,7 +21,9 @@ ini_set('include_path', $include_path.':'.dirname(__FILE__).'/../../');
|
||||||
|
|
||||||
require_once dirname(dirname(__FILE__)).'/conf/__init_conf__.php';
|
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) {
|
if (!$env) {
|
||||||
echo "Define PHABRICATOR_ENV before running this script.\n";
|
echo "Define PHABRICATOR_ENV before running this script.\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if ($argc > 1) {
|
||||||
|
$_SERVER['PHABRICATOR_ENV'] = $argv[1];
|
||||||
|
}
|
||||||
|
|
||||||
$root = dirname(dirname(dirname(__FILE__)));
|
$root = dirname(dirname(dirname(__FILE__)));
|
||||||
require_once $root.'/scripts/__init_script__.php';
|
require_once $root.'/scripts/__init_script__.php';
|
||||||
require_once $root.'/scripts/__init_env__.php';
|
require_once $root.'/scripts/__init_env__.php';
|
||||||
|
|
|
@ -47,7 +47,7 @@ probably means something like this:
|
||||||
Now, you can actually configure sendmail to deliver to Phabricator. In
|
Now, you can actually configure sendmail to deliver to Phabricator. In
|
||||||
##/etc/aliases##, add an entry like this:
|
##/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
|
...where <ENV> is the PHABRICATOR_ENV the script should run under. Run
|
||||||
##sudo newaliases##. Now you likely need to symlink this script into
|
##sudo newaliases##. Now you likely need to symlink this script into
|
||||||
|
|
Loading…
Reference in a new issue