From c4931852362c7a54498742ced909a81c42fc1209 Mon Sep 17 00:00:00 2001 From: listandshare Date: Fri, 3 Jun 2011 09:35:00 -0700 Subject: Bug fix in forward mail script --- scripts/forward_emails.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/forward_emails.php') 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); } ?> -- cgit v1.2.3