Ver Fonte

Changed so that attachments don't have to be saved on the server.

Luke Ehresman há 25 anos atrás
pai
commit
d6a84a74b5
9 ficheiros alterados com 36 adições e 25 exclusões
  1. 1 0
      ChangeLog
  2. 6 1
      INSTALL
  3. 6 5
      config/config.php
  4. 4 4
      functions/display_messages.php
  5. 7 1
      functions/mailbox.php
  6. 5 10
      functions/mime.php
  7. 2 2
      src/compose.php
  8. 3 0
      src/left_main.php
  9. 2 2
      src/read_body.php

+ 1 - 0
ChangeLog

@@ -1,6 +1,7 @@
 Version 0.2 -- January 02, 2000
 -------------------------------
 - Attachment support (better MIME support in general)
+- Themeable support replaced Custom Colors.  Themes are pluggable.
 
 
 Version 0.1.2  -- December 20, 1999

+ 6 - 1
INSTALL

@@ -8,5 +8,10 @@ overview of how to install SquirrelMail.
 
 3.  Edit the config file, config/config.php
 
-4.  Point your browser to the location you specified in step 2.
+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.
     In this example, it's:  http://YOURHOST/squirrelmail-0.1/index.html

+ 6 - 5
config/config.php

@@ -24,17 +24,18 @@
     $smtpPort = 25;
 
 //  This is displayed right after they log in
-    $motd = "";
-    $motd .= "You are using SquirrelMail's web-based email client.  If you run into any bugs or have ";
-    $motd .= "suggestions, please report them to our <A HREF=\"mailto:squirrelmail-list@sourceforge.net\">mailing list</A>";
+    $motd = "You are using SquirrelMail's web-based email client.  If you run into any bugs or have suggestions, please report them to our <A HREF=\"mailto:squirrelmail-list@sourceforge.net\">mailing list</A>";
 
-//  Customizable colors
+//  Themes
 //     You can define your own theme and put it in this directory.  You must
 //     call it as the example below.  You can name the theme whatever you
 //     want.  For an example of a theme, see the ones included in the config
 //     directory.
+//
+//     You can download themes from http://squirrelmail.sourceforge.net/index.php3?page=10
+//
 //   Example:   require("../config/default_theme.php");
-    require("../config/tan_theme.php");
+    require("../config/default_theme.php");
 
 //  Whether or not to use $color[11] for special folders.  If not, special
 //  folders will be the same color as the other folders

+ 4 - 4
functions/display_messages.php

@@ -9,7 +9,7 @@
 
     function error_username_password_incorrect($color) {
       echo "<BR>";
-      echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
+      echo "<TABLE COLS=1 WIDTH=75% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
       echo "   <TR>";
       echo "      <TD BGCOLOR=\"$color[0]\">";
       echo "         <FONT FACE=\"Arial,Helvetica\"><B><CENTER>ERROR</CENTER></B></FONT>";
@@ -22,15 +22,15 @@
 
     function general_info($motd, $org_logo, $version, $org_name, $color) {
       echo "<BR>";
-      echo "<TABLE COLS=1 WIDTH=70% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
+      echo "<TABLE COLS=1 WIDTH=80% NOBORDER BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
       echo "   <TR>";
       echo "      <TD BGCOLOR=\"$color[0]\">";
       echo "         <FONT FACE=\"Arial,Helvetica\"><B><CENTER>Welcome to $org_name's WebMail system</CENTER></B></FONT>";
       echo "   </TD></TR><TR><TD>";
       echo "   <TR><TD BGCOLOR=\"$color[4]\">";
-      echo "         <FONT FACE=\"Arial,Helvetica\" SIZE=-1><CENTER>Running SquirrelMail version $version (c) 1999 by Nathan and Luke Ehresman.</CENTER></FONT>";
+      echo "         <FONT FACE=\"Arial,Helvetica\" SIZE=-1><CENTER>Running SquirrelMail version $version (c) 1999-2000.</CENTER></FONT>";
       echo "   </TD></TR><TR><TD>";
-      echo "      <TABLE COLS=2 WIDTH=75% NOBORDER align=\"center\">";
+      echo "      <TABLE COLS=2 WIDTH=90% NOBORDER align=\"center\">";
       echo "         <TR>";
       echo "            <TD BGCOLOR=\"$color[4]\"><CENTER>";
       if (strlen($org_logo) > 3)

+ 7 - 1
functions/mailbox.php

@@ -240,7 +240,9 @@
    }
 
    /** This function gets all the information about a message.  Including Header and body **/
-   function fetchMessage($imapConnection, $id) {
+   function fetchMessage($imapConnection, $id, $mailbox) {
+      $message["INFO"]["ID"] = $id;
+      $message["INFO"]["MAILBOX"] = $mailbox;
       $message["HEADER"] = fetchHeader($imapConnection, $id);
       $message["ENTITIES"] = fetchBody($imapConnection, $message["HEADER"]["BOUNDARY"], $id, $message["HEADER"]["TYPE0"], $message["HEADER"]["TYPE1"]);
 
@@ -505,6 +507,10 @@
          $i++;
       }
 
+      if ( ($encoding == "us-ascii") && ($type0 != "text") && ($type0 != "message") ) {
+         $encoding = "base64";
+      }
+
       /** remove the header from the entity **/
       $i = 0;
       while (trim($read[$i]) != "") {

+ 5 - 10
functions/mime.php

@@ -144,18 +144,11 @@
                $display_filename = $filename;
             }
 
-            $body[$pos] .= "<TT>&nbsp;&nbsp;&nbsp;<A HREF=\"../data/$filename\">" . $display_filename . "</A>&nbsp;&nbsp;<SMALL>(TYPE: $type0/$type1)</SMALL></TT><BR>";
-            $file = fopen("../data/$filename", "w");
 
-            /** Determine what encoding type is used **/
-            if ($message["ENTITIES"][$i]["ENCODING"] == "base64") {
-               $thefile = base64_decode($message["ENTITIES"][$i]["BODY"][0]);
-            } else {
-               $thefile = $message["ENTITIES"][$i]["BODY"][0];
-            }
+            $urlMailbox = urlencode($message["INFO"]["MAILBOX"]);
+            $id = $message["INFO"]["ID"];
+            $body[$pos] .= "<TT>&nbsp;&nbsp;&nbsp;<A HREF=\"../src/download.php?passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$i\">" . $display_filename . "</A>&nbsp;&nbsp;<SMALL>(TYPE: $type0/$type1)</SMALL></TT><BR>";
 
-            fwrite($file, $thefile);
-            fclose($file);
          }
       }
 
@@ -181,6 +174,8 @@
             $body[$q] = ereg_replace("=3D", "=", $body[$q]);
          }
          $newbody = $body;
+      } else if ($encoding == "base64") {
+         $newbody = base64_decode($body);
       } else {
          $newbody = $body;
       }

+ 2 - 2
src/compose.php

@@ -14,7 +14,7 @@
 
    if ($forward_id) {
       selectMailbox($imapConnection, $mailbox, $numMessages);
-      $msg = fetchMessage($imapConnection, $forward_id);
+      $msg = fetchMessage($imapConnection, $forward_id, $mailbox);
 
       $body_ary = formatBody($msg);
       $tmp = "-------- Original Message ---------\n";
@@ -28,7 +28,7 @@
 
    if ($reply_id) {
       selectMailbox($imapConnection, $mailbox, $numMessages);
-      $msg = fetchMessage($imapConnection, $reply_id);
+      $msg = fetchMessage($imapConnection, $reply_id, $mailbox);
 
       $body_ary = formatBody($msg);
       for ($i=0;$i < count($body_ary);$i++) {

+ 3 - 0
src/left_main.php

@@ -27,6 +27,7 @@
       selectMailbox($imapConnection, $mailbox, $numNessages);
       $unseen = unseenMessages($imapConnection, $numUnseen);
 
+      echo "<NOBR>";
       if ($unseen)
          $line .= "<B>";
 
@@ -59,6 +60,8 @@
          $line .= "&nbsp;&nbsp;&nbsp;&nbsp;(<B><A HREF=\"empty_trash.php?numMessages=$numMessages&mailbox=$urlMailbox\" TARGET=right style=\"text-decoration:none\">empty</A></B>)";
          $line .= "</FONT></a>\n";
       }
+
+      echo "</NOBR>";
       return $line;
    }
 

+ 2 - 2
src/read_body.php

@@ -12,10 +12,10 @@
 
    // $message contains all information about the message
    // including header and body
-   $message = fetchMessage($imapConnection, $passed_id);
+   $message = fetchMessage($imapConnection, $passed_id, $mailbox);
+   echo "$mailbox, $passed_id<BR>";
 
    echo "<HTML>";
-   echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"" . $message["HEADER"]["TYPE"][0] . "/" . $message["HEADER"]["TYPE"][1] . "; charset=" . $message["HEADER"]["CHARSET"] . "\">";
    echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
    displayPageHeader($color, $mailbox);