diff options
author | listandshare <listandshare@ubuntu01.p4square.com> | 2011-06-03 09:35:00 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net ; true> | 2011-06-03 09:35:00 -0700 |
commit | c4931852362c7a54498742ced909a81c42fc1209 (patch) | |
tree | 767a0841c3944ab6c2c32621f56c755cee5be1b8 /scripts | |
parent | 33b3fa063eadbf96e7aaff6d66d0e3a7e8ca9cb3 (diff) |
Bug fix in forward mail script
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/forward_emails.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/forward_emails.php b/scripts/forward_emails.php index bd4846f..ae84ee3 100755 --- a/scripts/forward_emails.php +++ b/scripts/forward_emails.php @@ -9,7 +9,7 @@ * */ -require_once "../htdocs/src/base.inc.php"; +require_once __DIR__ . "/../htdocs/src/base.inc.php"; // Read the email $fd = fopen("php://stdin", "r"); @@ -67,7 +67,7 @@ foreach ($splitmsg as $line) { preg_match("/posting-(.+)@.+/", $to, $identifiers); if (!isset($identifiers[1]) or !is_numeric($identifiers[1])) { - mailFailure("Invalid id"); + mailFailure("Invalid id. '$to' " . print_r($identifiers, true)); } $id = $identifiers[1]; @@ -82,15 +82,15 @@ if (!$post or $post->getStage() != 'approved') { $newsubject = "[" . $CONFIG['sitetitle'] . "] $subject"; if (mail($post->getEmail(), $newsubject, $message, $headers)) { - exit 0; + exit(0); } else { - exit 2; + exit(2); } function mailFailure($message='') { echo "5.1.1 $message\n"; - exit 1; + exit(1); } ?> |