Added email addr parsing, added bugfix for boundary= header
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 10 Apr 2000 05:33:59 +0000 (05:33 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 10 Apr 2000 05:33:59 +0000 (05:33 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@391 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/display_messages.php
functions/imap_messages.php
functions/smtp.php
functions/strings.php
functions/url_parser.php
src/login.php
src/signout.php

index d099ec5..46e557b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
 Version 0.4pre1 -- Development
 ------------------------------
-- Parsing the body for URLs and translating them to links
+- Parsing the body for URLs and Email addrs
 - Added option to configure default folder directory. ie: ~/mail
 - Configuration script added: config/conf.pl
 - Addressbook with LDAP support
index 1428d0f..b07e2ae 100644 (file)
     function general_info($motd, $org_logo, $version, $org_name, $color) {
       echo "<BR>";
       echo "<TABLE COLS=1 WIDTH=80% CELLSPACING=0 CELLPADDING=2 NOBORDER ALIGN=CENTER><TR><TD BGCOLOR=\"$color[9]\">";
-      echo "<TABLE COLS=1 WIDTH=100% CELLSPACING=0 CELLPADDING=3 NOBORDER BGCOLOR=\"FFFFFF\" ALIGN=CENTER>";
+      echo "<TABLE COLS=1 WIDTH=100% CELLSPACING=0 CELLPADDING=3 NOBORDER BGCOLOR=\"#FFFFFF\" ALIGN=CENTER>";
       echo "   <TR>";
       echo "      <TD BGCOLOR=\"$color[0]\">";
       echo "         <B><CENTER>". _("Welcome to $org_name's WebMail system") ."</CENTER></B>";
-      echo "   <TR><TD BGCOLOR=\"FFFFFF\">";
+      echo "   <TR><TD BGCOLOR=\"#FFFFFF\">";
       echo "      <TABLE COLS=2 WIDTH=90% CELLSPACING=0 CELLPADDING=3 NOBORDER align=\"center\">";
       echo "         <TR>";
-      echo "            <TD BGCOLOR=\"FFFFFF\"><CENTER>";
+      echo "            <TD BGCOLOR=\"#FFFFFF\"><CENTER>";
       if (strlen($org_logo) > 3)
          echo "               <IMG SRC=\"$org_logo\">";
       else
          echo "               <B>$org_name</B>";
       echo "         <BR><CENTER>". _("Running SquirrelMail version $version (c) 1999-2000.") ."</CENTER><BR>";
       echo "            </CENTER></TD></TR><TR>";
-      echo "            <TD BGCOLOR=\"FFFFFF\">";
+      echo "            <TD BGCOLOR=\"#FFFFFF\">";
       echo "               $motd";
       echo "            </TD>";
       echo "         </TR>";
index 8604bb8..fe3255f 100755 (executable)
             }
 
             /** Detect the boundary of a multipart message **/
-            if (strpos(strtolower(trim($line)), "boundary=")) {
-               $pos = strpos(strtolower($line), "boundary=") + 9;
-               $bound = trim($line);
-               if (strpos($line, " ", $pos) > 0) {
-                  $bound = substr($bound, $pos, strpos($line, " ", $pos));
-               } else {
-                  $bound = substr($bound, $pos);
-               }
-               $bound = str_replace("\"", "", $bound);
-               $header["BOUNDARY"] = $bound;
+            if (eregi("boundary=\"([^\"]+)\"", $line, $regs)) {                             
+               $header["BOUNDARY"] = $regs[1];                                             
             }
 
             /** Detect the charset **/
index 2436c82..b87dc0c 100644 (file)
       }
 
       if ($status == 0) {
-         echo "<HTML><BODY BGCOLOR=ffffff>";
+         echo "<HTML><BODY BGCOLOR=#ffffff>";
          echo "<TT>";
          echo "<BR><B>ERROR</B><BR><BR>";
          echo "&nbsp;&nbsp;&nbsp;<B>Error Number: </B>$err_num<BR>";
index 44158c5..c9c6b9b 100644 (file)
             $line = "<TT><FONT COLOR=000000>$line</FONT></TT><BR>\n";
          }
 
+         $line = parseEmail ($line);
          $line = parseUrl ($line);
          $new_body[$i] = "$line";
       }
index 0a64d65..560c837 100644 (file)
       return $ret;
    }
 
+   function parseEmail ($body) {
+      $body = eregi_replace ("([a-z]|[0-9]|_|\.)+\@([a-z]|[0-9]|_)+(.([a-z]|[0-9]|_)+)*", "<a href=\"mailto:\\0\">\\0</a>", $body);
+      return $body;
+   }
+
    function parseUrl ($body) {
       #Possible ways a URL could finish.
 
index 9a00a2d..c6f4a10 100644 (file)
@@ -36,7 +36,7 @@
    echo "<HEAD><TITLE>";
    echo _("SquirrelMail Login");
    echo "</TITLE></HEAD>\n";
-   echo "<BODY TEXT=000000 BGCOLOR=FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
+   echo "<BODY TEXT=000000 BGCOLOR=#FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
  
    echo "<FORM ACTION=webmail.php METHOD=\"POST\" NAME=f>\n";
    echo "<CENTER><IMG SRC=\"$org_logo\"</CENTER>\n";
    echo "<BR></SMALL><CENTER>\n";
    echo "<TABLE COLS=1 WIDTH=350>\n";
    echo "   <TR>\n";
-   echo "      <TD BGCOLOR=DCDCDC>\n";
+   echo "      <TD BGCOLOR=#DCDCDC>\n";
    echo "         <B><CENTER>$org_name Login</CENTER></B>\n";
    echo "      </TD>\n";
    echo "   </TR><TR>\n";
-   echo "      <TD BGCOLOR=FFFFFF>\n";
+   echo "      <TD BGCOLOR=#FFFFFF>\n";
    echo "         <TABLE COLS=2 WIDTH=100%>\n";
    echo "            <TR>\n";
    echo "               <TD WIDTH=30% ALIGN=right>\n";
index 84ec5b5..74114c3 100644 (file)
 ?>
 <HTML>
 <?
-   echo "<BODY TEXT=000000 BGCOLOR=FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
-   echo "<BR><BR><TABLE BGCOLOR=FFFFFF BORDER=0 COLS=1 WIDTH=50% CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>";
-   echo "   <TR BGCOLOR=DCDCDC WIDTH=100%>";
+   echo "<BODY TEXT=000000 BGCOLOR=#FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
+   echo "<BR><BR><TABLE BGCOLOR=#FFFFFF BORDER=0 COLS=1 WIDTH=50% CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>";
+   echo "   <TR BGCOLOR=#DCDCDC WIDTH=100%>";
    echo "      <TD ALIGN=CENTER>";
    echo "         <B>";
    echo _("Sign Out");
    echo "</B>";
    echo "      </TD>";
    echo "   </TR>";
-   echo "   <TR BGCOLOR=FFFFFF WIDTH=100%>";
+   echo "   <TR BGCOLOR=#FFFFFF WIDTH=100%>";
    echo "      <TD ALIGN=CENTER>";
    echo "         <BR>";
    echo _("You have been successfully signed out.");
@@ -46,7 +46,7 @@
    echo "</A><BR><BR>";
    echo "      </TD>";
    echo "   </TR>";
-   echo "   <TR BGCOLOR=DCDCDC WIDTH=100%>";
+   echo "   <TR BGCOLOR=#DCDCDC WIDTH=100%>";
    echo "      <TD ALIGN=CENTER>";
    echo "         <BR>";
    echo "      </TD>";