added "reply-to" capabilities
[squirrelmail.git] / functions / mailbox.php
index 8f9c92ab0e5cc17595a909f639d78e245f6b9350..383da2df4aa8614d610c5ab094968b3dd67a8430 100644 (file)
    }
 
    function fetchHeader($imapConnection, $id) {
-      fputs($imapConnection, "messageFetch FETCH $id:$id RFC822.HEADER.LINES (From Subject Date To Cc Content-Type MIME-Version)\n");
+      fputs($imapConnection, "messageFetch FETCH $id:$id RFC822.HEADER\n");
       $read = fgets($imapConnection, 1024);
 
       /** defaults... if the don't get overwritten, it will display text **/
             }
 
          }
+
+         /** REPLY-TO **/
+         else if (substr($read, 0, 9) == "Reply-To:") {
+            $header["REPLYTO"] = trim(substr($read, 9, strlen($read)));
+            $read = fgets($imapConnection, 1024);
+         }
+
          /** FROM **/
          else if (substr($read, 0, 5) == "From:") {
             $header["FROM"] = trim(substr($read, 5, strlen($read) - 6));
+            if ($header["REPLYTO"] == "")
+               $header["REPLYTO"] = $header["FROM"];
             $read = fgets($imapConnection, 1024);
          }
          /** DATE **/