From 97be216806423d7008317ac7b4ca81ca8a4c8504 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Mon, 3 Jan 2000 12:23:03 +0000 Subject: [PATCH] Changed so that attachments don't have to be saved on the server. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@100 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + INSTALL | 7 ++++++- config/config.php | 11 ++++++----- functions/display_messages.php | 8 ++++---- functions/mailbox.php | 8 +++++++- functions/mime.php | 15 +++++---------- src/compose.php | 4 ++-- src/left_main.php | 3 +++ src/read_body.php | 4 ++-- 9 files changed, 36 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2d46bff..3e2a8a32 100644 --- a/ChangeLog +++ b/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 diff --git a/INSTALL b/INSTALL index a10c4866..72f3eae7 100644 --- a/INSTALL +++ b/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 + 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 diff --git a/config/config.php b/config/config.php index ad98ee56..28314a52 100644 --- a/config/config.php +++ b/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 mailing list"; + $motd = "You are using SquirrelMail's web-based email client. If you run into any bugs or have suggestions, please report them to our mailing list"; -// 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 diff --git a/functions/display_messages.php b/functions/display_messages.php index 6dcc4a65..d5d4931e 100644 --- a/functions/display_messages.php +++ b/functions/display_messages.php @@ -9,7 +9,7 @@ function error_username_password_incorrect($color) { echo "
"; - echo ""; + echo "
"; echo " "; echo "
"; echo "
ERROR
"; @@ -22,15 +22,15 @@ function general_info($motd, $org_logo, $version, $org_name, $color) { echo "
"; - echo ""; + echo "
"; echo " "; echo "
"; echo "
Welcome to $org_name's WebMail system
"; echo "
"; echo "
"; - echo "
Running SquirrelMail version $version (c) 1999 by Nathan and Luke Ehresman.
"; + echo "
Running SquirrelMail version $version (c) 1999-2000.
"; echo "
"; - echo " "; + echo "
"; echo " "; echo "
"; if (strlen($org_logo) > 3) diff --git a/functions/mailbox.php b/functions/mailbox.php index 056abb2f..38fe457e 100644 --- a/functions/mailbox.php +++ b/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]) != "") { diff --git a/functions/mime.php b/functions/mime.php index 4ddc0e5e..33148ada 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -144,18 +144,11 @@ $display_filename = $filename; } - $body[$pos] .= "   " . $display_filename . "  (TYPE: $type0/$type1)
"; - $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] .= "   " . $display_filename . "  (TYPE: $type0/$type1)
"; - 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; } diff --git a/src/compose.php b/src/compose.php index cfa8136c..41db1b7c 100644 --- a/src/compose.php +++ b/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++) { diff --git a/src/left_main.php b/src/left_main.php index 39a210ef..76da5f30 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -27,6 +27,7 @@ selectMailbox($imapConnection, $mailbox, $numNessages); $unseen = unseenMessages($imapConnection, $numUnseen); + echo ""; if ($unseen) $line .= ""; @@ -59,6 +60,8 @@ $line .= "    (empty)"; $line .= "\n"; } + + echo ""; return $line; } diff --git a/src/read_body.php b/src/read_body.php index 256a05ae..050f1c5a 100644 --- a/src/read_body.php +++ b/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
"; echo ""; - echo ""; echo "\n"; displayPageHeader($color, $mailbox); -- 2.25.1