Rewrote multipart/* algorithm to be recursive
[squirrelmail.git] / functions / mailbox.php
index 38fe457e9a92a73c0fbdb51ef040042da22f8092..bb281879ab2f75af62657e237546dd5160e588f7 100644 (file)
       $message["INFO"]["MAILBOX"] = $mailbox;
       $message["HEADER"] = fetchHeader($imapConnection, $id);
       $message["ENTITIES"] = fetchBody($imapConnection, $message["HEADER"]["BOUNDARY"], $id, $message["HEADER"]["TYPE0"], $message["HEADER"]["TYPE1"]);
-
       return $message;
    }
 
       $read = $entity;
    }
 
+   function parseHTMLMessage($line) {
+      /** Add any parsing you want to in here **/
+      return $line;
+   }
+
    function parsePlainTextMessage($line) {
+      /** Add any parsing you want to in here */
+
       $line = "^^$line";
 
       if ((strpos(strtolower($line), "<!") == false) &&
       $line = str_replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", $line);
       $line = str_replace("\n", "", $line);
 
-      /** if >> or > are found at the beginning of a line, I'll assume that was
-          replied text, so make it different colors **/
       if (strpos(trim(str_replace("&nbsp;", "", $line)), "&gt;&gt;") == 2) {
          $line = substr($line, 2, strlen($line));
          $line = "<TT><FONT COLOR=FF0000>$line</FONT></TT><BR>\n";
          $line = "<TT><FONT COLOR=000000>$line</FONT></TT><BR>\n";
       }
 
-      /** This translates "http://" into a link.  It could be made better to accept
-          "www" and "mailto" also.  That should probably be added later. **/
       if (strpos(strtolower($line), "http://") != false) {
          $line = ereg_replace("<BR>", "", $line);
          $start = strpos(strtolower($line), "http://");