From bdd963a85e811b5987917b6e2d67dd6c87de2b54 Mon Sep 17 00:00:00 2001 From: listandshare on ubuntu01 Date: Fri, 3 Jun 2011 10:08:48 -0700 Subject: Bug fixes in email script --- scripts/forward_emails.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'scripts/forward_emails.php') diff --git a/scripts/forward_emails.php b/scripts/forward_emails.php index 92c7563..e811443 100755 --- a/scripts/forward_emails.php +++ b/scripts/forward_emails.php @@ -29,6 +29,7 @@ $message = ""; $splitmsg = split("\n", $email); $inheaders = true; +array_shift($splitmsg); // Ignore the first line, postfix garbage foreach ($splitmsg as $line) { if ($inheaders) { // This is a header @@ -39,9 +40,6 @@ foreach ($splitmsg as $line) { $header = split(':', $line, 2); switch (strtolower(trim($header[0]))) { - case 'from': - $from = $header[1]; - break; case 'subject': $subject = $header[1]; @@ -53,6 +51,13 @@ foreach ($splitmsg as $line) { case 'delivered-to': break; + + case 'to': + break; + + case 'from': + $from = $header[1]; + // Intentionally fall through here default: $headers .= "$line\n"; -- cgit v1.2.3