Added stylesheets with default Comic Sans MS and Bitstream Vera Sans/Verdana
[squirrelmail.git] / class / mime / Rfc822Header.class.php
index 0b35277aab2d6bfb3f4349623eb69e088a759817..9f495f24eca096827c9955aa7cad9b790cba8817 100644 (file)
@@ -21,6 +21,7 @@ class Rfc822Header {
         $from = array(),
         $sender = '',
         $reply_to = array(),
+        $mail_followup_to = array(),
         $to = array(),
         $cc = array(),
         $bcc = array(),
@@ -125,6 +126,9 @@ class Rfc822Header {
             case 'reply-to':
                 $this->reply_to = $this->parseAddress($value, true);
                 break;
+            case 'mail-followup-to':
+                $this->mail_followup_to = $this->parseAddress($value, true);
+                break;
             case 'to':
                 $this->to = $this->parseAddress($value, true);
                 break;
@@ -293,13 +297,13 @@ class Rfc822Header {
                 // check the next token in case comments appear in the middle of email addresses
                 $prevToken = end($aTokens);
                 if (!in_array($prevToken,$aSpecials,true)) {
-                    if (isset($address{$i+1}) && !in_array($address{$i+1},$aSpecials,true)) {
+                    if ($i+1<strlen($address) && !in_array($address{$i+1},$aSpecials,true)) {
                         $iEnd = strpos($address,' ',$i+1);
                         if ($iEnd) {
                             $sNextToken = trim(substr($address,$i+1,$iEnd - $i -1));
                             $i = $iEnd-1;
                         } else {
-                            $sToken = trim(substr($address,$i+1));
+                            $sNextToken = trim(substr($address,$i+1));
                             $i = $iCnt;
                         }
                         // remove the token
@@ -469,7 +473,11 @@ class Rfc822Header {
                 if ($sHost && $oAddr->mailbox) {
                     $oAddr->host = $sHost;
                 }
-            }
+            } else if (!$grouplookup && !$oAddr->host) {
+                if ($sHost && $oAddr->mailbox) {
+                    $oAddr->host = $sHost;
+                }
+           }
           }
           if (!$aAddrBookAddress && $oAddr->mailbox) {
               $aProcessedAddress[] = $oAddr;