diff options
author | listandshare on ubuntu01 <jmorgan@foursquarestaff.com> | 2011-06-03 10:08:48 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net ; true> | 2011-06-03 10:08:48 -0700 |
commit | bdd963a85e811b5987917b6e2d67dd6c87de2b54 (patch) | |
tree | 1fd64347b1d0694e4765d175d1ecbe20eb5be8cf | |
parent | 546f20c9f81b2a3e515141726c50d2621c2411df (diff) |
Bug fixes in email script
-rwxr-xr-x | scripts/forward_emails.php | 11 |
1 files changed, 8 insertions, 3 deletions
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"; |