just cleaning up some stuff
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 5 Jan 2000 21:12:57 +0000 (21:12 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 5 Jan 2000 21:12:57 +0000 (21:12 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@105 7612ce4b-ef26-0410-bec9-ea0150e637f0

14 files changed:
AUTHORS
ChangeLog
INSTALL
README
config/config.php
functions/mime.php
functions/smtp.php
functions/strings.php
images/logo.gif [deleted file]
images/sm_logo.jpg [new file with mode: 0644]
src/compose.php
src/compose_send.php
src/download.php
src/login.php

diff --git a/AUTHORS b/AUTHORS
index 1ebe068..82ab26a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,3 @@
-Nathan Ehresman
 Luke Ehresman
+Nathan Ehresman
+Sergiusz Pawlowicz
index 739ed34..653a314 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Version 0.2.1 -- January 05, 2000
+---------------------------------
+- Rewrote how MULTIPART messages were handled and made it recursive
+- We now take into account the encoding type rather than guessing
+- Redesigned how attachments are displayed
+- Fixed the bug that wouldn't let you send messages (I hope)
+- Added a "download message" option
+- Added a plain text viewer for text messages
+
 Version 0.2 -- January 02, 2000
 -------------------------------
 - Attachment support (much better MIME support in general)
diff --git a/INSTALL b/INSTALL
index 72f3eae..a10c486 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -8,10 +8,5 @@ overview of how to install SquirrelMail.
 
 3.  Edit the config file, config/config.php
 
-4.  Change permissions of the "data/" directory so that the web server
-    can write to it.  Here is an example from Red Hat 6.0:
-       cd <SQUIRREMAIL DIRECTORY>
-       chown nobody data
-
-5.  Point your browser to the location you specified in step 2.
+4.  Point your browser to the location you specified in step 2.
     In this example, it's:  http://YOURHOST/squirrelmail-0.1/index.html
diff --git a/README b/README
index 5a21458..853f64b 100644 (file)
--- a/README
+++ b/README
@@ -15,7 +15,7 @@ FAQ ................................................................. 4.0
   Can SquirrelMail run with PHP3? ................................... 4.1
   Why PHP4 when it's only in BETA? .................................. 4.2
   Where did you get the name "SquirrelMail?" ........................ 4.3
-
+  Is SquirrelMail stable enough to actually use? .................... 4.4
 
 
 
@@ -108,4 +108,9 @@ FAQ ................................................................. 4.0
       this year. We were playing volleyball one day, and saw a squirrel
       try to jump between trees. He failed miserably and fell 40 feet to
       the ground. So, we had squirrels on our mind the next day when we
-      were coming up with a name.
\ No newline at end of file
+      were coming up with a name.
+      
+   Q: Is SquirrelMail stable enough to actually use?
+      SquirrelMail is stable, however, many of the features that are 
+      usually desired from an email client have not yet been implemented.
+
index 28314a5..f90446d 100644 (file)
@@ -1,6 +1,6 @@
 <?
 //  Organization's logo picture (blank if none)
-    $org_logo = "../images/logo.gif";
+    $org_logo = "../images/sm_logo.jpg";
 
 //  Organization's name
     $org_name = "SquirrelMail";
index 068c754..f81d08f 100644 (file)
@@ -62,7 +62,7 @@
          /** If this isn't a multipart message **/
          $j = 0;
          $entity_body = "";
-         while ((substr(trim($body[$j]), 0, strlen("--$bound")) != "--$bound") && ($j < count($body))) {
+         while ($j < count($body)) {
             $entity_body .= $body[$j];
             $j++;
          }
          }
       }
 
+      /** If there are other types that shouldn't be formatted, add them here **/
+      if ($message["ENTITIES"][$ent_num]["TYPE1"] != "html")
+         $body = translateText($body);
+
       $body .= "<BR><SMALL><CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$ent_num&mailbox=$urlmailbox\">Download this as a file</A></CENTER><BR></SMALL>";
 
       /** Display the ATTACHMENTS: message if there's more than one part **/
index 2274bc1..9d985d1 100644 (file)
@@ -75,5 +75,7 @@
       fputs($smtpConnection, ".\n"); // end the DATA part
       fputs($smtpConnection, "QUIT\n"); // log off
       echo "</FONT>";
+
+      fclose($smtpConnection);
    }
 ?>
\ No newline at end of file
index dce7f1a..5afc65f 100644 (file)
       return $to_line;
    }
 
+   function translateText($body) {
+      $body = ereg_replace(" ", "&nbsp;", $body);
+      return $body;
+   }
+
    /* SquirrelMail version number -- DO NOT CHANGE */
-   $version = "0.2";
+   $version = "0.2.1";
 ?>
diff --git a/images/logo.gif b/images/logo.gif
deleted file mode 100644 (file)
index 15f1c63..0000000
Binary files a/images/logo.gif and /dev/null differ
diff --git a/images/sm_logo.jpg b/images/sm_logo.jpg
new file mode 100644 (file)
index 0000000..e0e400a
Binary files /dev/null and b/images/sm_logo.jpg differ
index 41db1b7..1f26644 100644 (file)
       selectMailbox($imapConnection, $mailbox, $numMessages);
       $msg = fetchMessage($imapConnection, $forward_id, $mailbox);
 
-      $body_ary = formatBody($msg);
+      if (containsType($msg, "text", "html", $ent_num)) {
+         $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"]);
+      } else if (containsType($msg, "text", "plain", $ent_num)) {
+         $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"]);
+      }
+      // add other primary displaying msg types here
+      else {
+         // find any type that's displayable
+         if (containsType($msg, "text", "any_type", $ent_num)) {
+            $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"]);
+         } else if (containsType($msg, "msg", "any_type", $ent_num)) {
+            $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"]);
+         } else {
+            $body = "No Message";
+         }
+      }
+
+      $type1 = $msg["ENTITIES"][$ent_num]["TYPE1"];
+
       $tmp = "-------- Original Message ---------\n";
+      $body_ary = explode("\n", $body);
+      $body = "";
       for ($i=0;$i < count($body_ary);$i++) {
-         $tmp .= strip_tags($body_ary[$i]);
-         $tmp = substr($tmp, 0, strlen($tmp) -1);
-         $body = "$body$tmp";
+         if ($type1 == "html")
+            $tmp .= strip_tags($body_ary[$i]);
+         else
+            $tmp .= $body_ary[$i];
+         $body = "$body$tmp\n";
          $tmp = "";
       }
    }
       selectMailbox($imapConnection, $mailbox, $numMessages);
       $msg = fetchMessage($imapConnection, $reply_id, $mailbox);
 
-      $body_ary = formatBody($msg);
+      if (containsType($msg, "text", "html", $ent_num)) {
+         $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false);
+      } else if (containsType($msg, "text", "plain", $ent_num)) {
+         $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false);
+      }
+      // add other primary displaying msg types here
+      else {
+         // find any type that's displayable
+         if (containsType($msg, "text", "any_type", $ent_num)) {
+            $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false);
+         } else if (containsType($msg, "msg", "any_type", $ent_num)) {
+            $body = decodeBody($msg["ENTITIES"][$ent_num]["BODY"], $msg["ENTITIES"][$ent_num]["ENCODING"], false);
+         } else {
+            $body = "No Message";
+         }
+      }
+
+      $type1 = $msg["ENTITIES"][$ent_num]["TYPE1"];
+
+      $body_ary = explode("\n", $body);
+      $body = "";
       for ($i=0;$i < count($body_ary);$i++) {
-         $tmp = strip_tags($body_ary[$i]);
-         $tmp = substr($tmp, 0, strlen($tmp) -1);
-         $body = "$body> $tmp";
+         if ($type1 == "html")
+            $tmp = strip_tags($body_ary[$i]);
+         else
+            $tmp = $body_ary[$i];
+         $body = "$body> $tmp\n";
       }
    }
 
index a0cdabd..9bbc254 100644 (file)
@@ -45,7 +45,7 @@
 
    sendMessage($smtpServerAddress, $smtpPort, $username, $domain, $passed_to, $passed_cc, $passed_bcc, $passed_subject, $passed_body, $version);
 
-   if ($auto_forwarding == true)
+   if ($auto_forward == true)
       echo "<META HTTP-EQUIV=\"REFRESH\" CONTENT=\"0;URL=right_main.php\">";
    echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
 
index 56c5733..094dc04 100644 (file)
@@ -15,7 +15,7 @@
       echo "<B><CENTER>Viewing a plain text attachment</CENTER></B>";
       echo "</TD></TR><TR><TD BGCOLOR=\"$color[4]\">";
       $urlmailbox = urlencode($mailbox);
-      echo "<FONT FACE=\"Arial, Helvetica\"><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$entid&mailbox=$urlmailbox\">Download this as a file</A><BR><BR></FONT><TT>";
+      echo "<FONT FACE=\"Arial, Helvetica\"><CENTER><A HREF=\"../src/download.php?absolute_dl=true&passed_id=$id&passed_ent_id=$entid&mailbox=$urlmailbox\">Download this as a file</A></CENTER><BR><BR></FONT><TT>";
       echo nl2br($body);
       echo "</TT></TD></TR></TABLE>";
    }
       switch($type0) {
          case "text":
             $body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]);
-            header("Content-type: $type0/$type1");
+            header("Content-type: $type0/$type1; name=\"$filename\"");
             header("Content-Disposition: attachment; filename=\"$filename\"");
             echo $body;
             break;
          default:
             $body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]);
-            header("Content-type: $type0/$type1");
+            header("Content-type: $type0/$type1; name=\"$filename\"");
             header("Content-Disposition: attachment; filename=\"$filename\"");
             echo $body;
             break;
@@ -62,7 +62,7 @@
             break;
          default:
             $body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]);
-            header("Content-type: $type0/$type1");
+            header("Content-type: $type0/$type1; name=\"$filename\"");
             header("Content-Disposition: attachment; filename=\"$filename\"");
             echo $body;
             break;
index 714c144..7e0b498 100644 (file)
@@ -18,7 +18,7 @@
    echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
    echo "<FORM ACTION=webmail.php METHOD=\"POST\" NAME=f>\n";
    echo "<CENTER><IMG SRC=\"$org_logo\"</CENTER>\n";
-   echo "<CENTER><FONT FACE=\"Arial,Helvetica\" SIZE=-2>SquirrelMail version $version<BR>By Nathan and Luke Ehresman<BR></FONT><CENTER>\n";
+   echo "<CENTER><FONT FACE=\"Arial,Helvetica\" SIZE=-2>SquirrelMail version $version<BR>By the SquirrelMail Development Team<BR></FONT><CENTER>\n";
    echo "<TABLE COLS=1 WIDTH=350>\n";
    echo "   <TR>\n";
    echo "      <TD BGCOLOR=\"$color[0]\">\n";