summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorlistandshare on ubuntu01 <jmorgan@foursquarestaff.com>2011-06-03 10:08:48 -0700
committerJesse Morgan <jesse@jesterpm.net ; true>2011-06-03 10:08:48 -0700
commitbdd963a85e811b5987917b6e2d67dd6c87de2b54 (patch)
tree1fd64347b1d0694e4765d175d1ecbe20eb5be8cf /scripts
parent546f20c9f81b2a3e515141726c50d2621c2411df (diff)
Bug fixes in email script
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/forward_emails.php11
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";