-Nathan Ehresman
Luke Ehresman
+Nathan Ehresman
+Sergiusz Pawlowicz
+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)
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
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
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.
+
<?
// Organization's logo picture (blank if none)
- $org_logo = "../images/logo.gif";
+ $org_logo = "../images/sm_logo.jpg";
// Organization's name
$org_name = "SquirrelMail";
/** 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 **/
fputs($smtpConnection, ".\n"); // end the DATA part
fputs($smtpConnection, "QUIT\n"); // log off
echo "</FONT>";
+
+ fclose($smtpConnection);
}
?>
\ No newline at end of file
return $to_line;
}
+ function translateText($body) {
+ $body = ereg_replace(" ", " ", $body);
+ return $body;
+ }
+
/* SquirrelMail version number -- DO NOT CHANGE */
- $version = "0.2";
+ $version = "0.2.1";
?>
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";
}
}
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";
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;
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;
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";