//
// You can download themes from http://squirrelmail.sourceforge.net/index.php3?page=10
//
-// Example: require("../config/default_theme.php");
- require("../config/default_theme.php");
+// To add a new theme to the options that users can choose from, just add
+// a new number to the array at the bottom, and follow the pattern.
+
+ $theme[0]["PATH"] = "../config/default_theme.php"; // This is your default theme. Can be theme.
+ $theme[0]["NAME"] = "Default";
+
+ $theme[1]["PATH"] = "../config/sandstorm_theme.php";
+ $theme[1]["NAME"] = "Sand Storm";
+
+ $theme[2]["PATH"] = "../config/deepocean_theme.php";
+ $theme[2]["NAME"] = "Deep Ocean";
+
+ $theme[3]["PATH"] = "../config/slashdot_theme.php";
+ $theme[3]["NAME"] = "Slashdot";
+
// Whether or not to use $color[11] for special folders. If not, special
// folders will be the same color as the other folders
--- /dev/null
+<?
+ /** Author: Luke Ehresman
+ Date: January 3, 2000
+ Theme Name: "Deep Blue"
+
+ Deep Ocean is a theme that is very blue.
+ **/
+
+ $color[0] = "597E9B"; // (light gray) TitleBar
+ $color[1] = "800000"; // (red)
+ $color[2] = "CC0000"; // (light red) Warning/Error Messages
+ $color[3] = "183667"; // (green-blue) Left Bar Background
+ $color[4] = "7A9CBF"; // (white) Normal Background
+ $color[5] = "B5C9DF"; // (light yellow) Table Headers
+ $color[6] = "FFFFFF"; // (black) Text on left bar
+ $color[7] = "014D7B"; // (blue) Links
+ $color[8] = "000000"; // (black) Normal text
+ $color[9] = "ABABAB"; // (mid-gray) Darker version of #0
+ $color[10] = "666666"; // (dark gray) Darker version of #9
+ $color[11] = "A7C5F3"; // (dark red) Special Folders color
+?>
\ No newline at end of file
--- /dev/null
+<?
+ /** Author: Luke Ehresman
+ Date: January 2, 2000
+ Theme Name: "Sand Storm"
+
+ This is a theme using Tan as its main color.
+ **/
+
+ $color[0] = "CFB789"; // (darker tan) TitleBar
+ $color[1] = "800000"; // (red)
+ $color[2] = "CC0000"; // (light red) Warning/Error Messages
+ $color[3] = "AF9769"; // (tan) Left Bar Background
+ $color[4] = "FFE9BF"; // (light tan) Normal Background
+ $color[5] = "FFFFCC"; // (light yellow) Table Headers
+ $color[6] = "000000"; // (black) Text on left bar
+ $color[7] = "8B6029"; // (blue) Links
+ $color[8] = "000000"; // (black) Normal text
+ $color[9] = "BFA779"; // (mid tan) Darker version of #0
+ $color[10] = "8F7739"; // (dark tan) Darker version of #9
+ $color[11] = "770000"; // (dark red) Special Folders color
+?>
--- /dev/null
+<?
+ /** Author: Luke Ehresman
+ Date: January 3, 2000
+ Theme Name: "Slashdot Theme"
+
+ This theme tries to mimic the color scheme from the "News
+ for Nerds" web site, www.slashdot.org.
+ **/
+
+ $color[0] = "DCDCDC"; // (light gray) TitleBar
+ $color[1] = "800000"; // (red)
+ $color[2] = "CC0000"; // (light red) Warning/Error Messages
+ $color[3] = "006668"; // (/. color) Left Bar Background
+ $color[4] = "FFFFFF"; // (white) Normal Background
+ $color[5] = "BABABA"; // (darker gray) Table Headers
+ $color[6] = "000000"; // (black) Text on left bar
+ $color[7] = "004949"; // (light /. color) Links
+ $color[8] = "000000"; // (black) Normal text
+ $color[9] = "ABABAB"; // (mid-gray) Darker version of #0
+ $color[10] = "666666"; // (dark gray) Darker version of #9
+ $color[11] = "770000"; // (dark red) Special Folders color
+?>
\ No newline at end of file
-full_name=Luke Ehresman
+full_name=
reply_to=
+chosen_theme=../config/default_theme.php
/**
** This function loops through a group of messages in the mailbox and shows them
**/
- function showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort) {
+ function showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color) {
include ("../config/config.php");
if (1 <= $numMessages) {
as the actual message in the HTML. It contains everything needed, including
HTML Tags, Attachments at the bottom, etc.
**/
- function formatBody($message) {
- include ("../config/config.php");
+ function formatBody($message, $color) {
/** this if statement checks for the entity to show as the primary message. To
add more of them, just put them in the order that is their priority.
$body .= decodeBody($message["ENTITIES"][$ent_num]["BODY"], $message["ENTITIES"][$ent_num]["ENCODING"]);
} else if (containsType($message, "text", "plain", $ent_num)) {
$tmpbody = decodeBody($message["ENTITIES"][$ent_num]["BODY"], $message["ENTITIES"][$ent_num]["ENCODING"]);
- $body .= "<TT>" . nl2br($tmpbody) . "</TT>";
+ $body .= "<TT>" . nl2br(trim($tmpbody)) . "</TT>";
}
// add other primary displaying message types here
else {
// find any type that's displayable
if (containsType($message, "text", "any_type", $ent_num)) {
$tmpbody = decodeBody($message["ENTITIES"][$ent_num]["BODY"], $message["ENTITIES"][$ent_num]["ENCODING"]);
- $body .= "<TT>" . nl2br($tmpbody) . "</TT>";
+ $body .= "<TT>" . nl2br(trim($tmpbody)) . "</TT>";
} else if (containsType($message, "message", "any_type", $ent_num)) {
$tmpbody = decodeBody($message["ENTITIES"][$ent_num]["BODY"], $message["ENTITIES"][$ent_num]["ENCODING"]);
- $body .= "<TT>" . nl2br($tmpbody) . "</TT>";
+ $body .= "<TT>" . nl2br(trim($tmpbody)) . "</TT>";
}
}
$pref = fgets($file, 1024);
if (substr($pref, 0, strpos($pref, "=")) == $string) {
fclose($file);
- return substr($pref, strpos($pref, "=")+1);
+ return trim(substr($pref, strpos($pref, "=")+1));
}
}
fclose($file);
function sendMessage($smtpServerAddress, $smtpPort, $username, $domain, $t, $c, $b, $subject, $body, $version) {
include("../config/config.php");
+ include("../functions/prefs.php");
$to = parseAddrs($t);
$cc = parseAddrs($c);
$bcc = parseAddrs($b);
$body = stripslashes($body);
- $from = "$username@$domain";
+ $from_addr = "$username@$domain";
+ $reply_to = getPref($username, "reply_to");
+ $from = getPref($username, "full_name");
+ if ($from == "")
+ $from = "<$username@$domain>";
+ else
+ $from = $from . " <$username@$domain>";
+
- echo "<FONT FACE=\"Arial,Helvetica\">";
$smtpConnection = fsockopen($smtpServerAddress, $smtpPort, $errorNumber, $errorString);
if (!$smtpConnection) {
echo "Error connecting to SMTP Server.<br>";
echo "$errorNumber : $errorString<br>";
exit;
- } else {
- $tmp = fgets($smtpConnection, 1024);
}
+ $tmp = nl2br(htmlspecialchars(fgets($smtpConnection, 1024)));
$to_list = getLineOfAddrs($to);
$cc_list = getLineOfAddrs($cc);
/** Lets introduce ourselves */
fputs($smtpConnection, "HELO $domain\n");
+ $tmp = nl2br(htmlspecialchars(fgets($smtpConnection, 1024)));
/** Ok, who is sending the message? */
- fputs($smtpConnection, "MAIL FROM:<$from>\n");
+ fputs($smtpConnection, "MAIL FROM:$from_addr\n");
+ $tmp = nl2br(htmlspecialchars(fgets($smtpConnection, 1024)));
/** send who the recipients are */
for ($i = 0; $i < count($to); $i++) {
fputs($smtpConnection, "RCPT TO:<$to[$i]>\n");
+ $tmp = nl2br(htmlspecialchars(fgets($smtpConnection, 1024)));
}
for ($i = 0; $i < count($cc); $i++) {
fputs($smtpConnection, "RCPT TO:<$cc[$i]>\n");
+ $tmp = nl2br(htmlspecialchars(fgets($smtpConnection, 1024)));
}
for ($i = 0; $i < count($bcc); $i++) {
fputs($smtpConnection, "RCPT TO:<$bcc[$i]>\n");
+ $tmp = nl2br(htmlspecialchars(fgets($smtpConnection, 1024)));
}
/** Lets start sending the actual message */
fputs($smtpConnection, "DATA\n");
+ $tmp = nl2br(htmlspecialchars(fgets($smtpConnection, 1024)));
fputs($smtpConnection, "Subject: $subject\n"); // Subject
- fputs($smtpConnection, "From: <$from>\n"); // Subject
+ fputs($smtpConnection, "From: $from\n"); // Subject
fputs($smtpConnection, "To: <$to_list>\n"); // Who it's TO
if ($cc_list) {
fputs($smtpConnection, "Cc: <$cc_list>\n"); // Who the CCs are
}
fputs($smtpConnection, "X-Mailer: SquirrelMail (version $version)\n"); // Identify SquirrelMail
- fputs($smtpConnection, "Reply-To: $from\n");
+ fputs($smtpConnection, "Reply-To: $reply_to\n");
fputs($smtpConnection, "MIME-Version: 1.0\n");
fputs($smtpConnection, "Content-Type: text/plain\n");
fputs($smtpConnection, "$body\n"); // send the body of the message
fputs($smtpConnection, ".\n"); // end the DATA part
+ $tmp = nl2br(htmlspecialchars(fgets($smtpConnection, 1024)));
+
fputs($smtpConnection, "QUIT\n"); // log off
- echo "</FONT>";
fclose($smtpConnection);
}
}
/* SquirrelMail version number -- DO NOT CHANGE */
- $version = "0.2.1";
+ $version = "0.3pre1";
?>
include("../functions/date.php");
include("../functions/mime.php");
+ include("../src/load_prefs.php");
echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
$imapConnection = loginToImapServer($username, $key, $imapServerAddress);
include("../functions/smtp.php");
include("../functions/display_messages.php");
+ include("../src/load_prefs.php");
+
if ($passed_body == "") {
echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
displayPageHeader($color, "None");
include("../functions/display_messages.php");
include("../functions/imap.php");
+ include("../src/load_prefs.php");
+
echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
$imapConnection = loginToImapServer($username, $key, $imapServerAddress);
include("../functions/mailbox.php");
include("../functions/date.php");
+ include("../src/load_prefs.php");
+
function viewText($color, $body, $id, $entid, $mailbox) {
echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
displayPageHeader($color, "None");
echo "</TD></TR><TR><TD BGCOLOR=\"$color[4]\">";
$urlmailbox = urlencode($mailbox);
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 nl2br(trim($body));
echo "</TT></TD></TR></TABLE>";
}
$body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]);
header("Content-type: $type0/$type1; name=\"$filename\"");
header("Content-Disposition: attachment; filename=\"$filename\"");
- echo $body;
+ echo trim($body);
break;
default:
$body = decodeBody($message["ENTITIES"][$passed_ent_id]["BODY"], $message["ENTITIES"][$passed_ent_id]["ENCODING"]);
include("../functions/imap.php");
include("../functions/array.php");
+ include("../src/load_prefs.php");
+
$imapConnection = loginToImapServer($username, $key, $imapServerAddress);
getFolderList($imapConnection, $boxes);
include("../functions/mailbox.php");
include("../functions/array.php");
+ include("../src/load_prefs.php");
+
echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
displayPageHeader($color, "None");
include("../functions/imap.php");
include("../functions/display_messages.php");
+ include("../src/load_prefs.php");
+
echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
displayPageHeader($color, "None");
include("../functions/mailbox.php");
include("../functions/array.php");
+ include("../src/load_prefs.php");
+
echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
$imapConnection = loginToImapServer($username, $key, $imapServerAddress);
getFolderList($imapConnection, $boxes);
include("../functions/imap.php");
include("../functions/mailbox.php");
+ include("../src/load_prefs.php");
+
$imapConnection = loginToImapServer($username, $key, $imapServerAddress);
$dm = findMailboxDelimeter($imapConnection);
include("../functions/imap.php");
include("../functions/mailbox.php");
+ include("../src/load_prefs.php");
+
$imapConnection = loginToImapServer($username, $key, $imapServerAddress);
selectMailbox($imapConnection, $old, $numMessages);
include("../functions/imap.php");
include("../functions/mailbox.php");
- function formatMailboxName($imapConnection, $mailbox, $delimeter) {
+ include("../src/load_prefs.php");
+
+ function formatMailboxName($imapConnection, $mailbox, $delimeter, $color) {
require ("../config/config.php");
$mailboxURL = urlencode($mailbox);
$line .= readShortMailboxName($mailbox, $delimeter);
$line .= "</FONT><FONT FACE=\"Arial,Helvetica\">";
} else {
- $line .= formatMailboxName($imapConnection, $mailbox, $delimeter);
+ $line .= formatMailboxName($imapConnection, $mailbox, $delimeter, $color);
}
} else {
- $line .= formatMailboxName($imapConnection, $mailbox, $delimeter);
+ $line .= formatMailboxName($imapConnection, $mailbox, $delimeter, $color);
}
echo "$line<BR>";
}
--- /dev/null
+<?
+ include("../functions/prefs.php");
+
+ $chosen_theme = getPref($username, "chosen_theme");
+
+ if (isset($chosen_theme)) {
+ require("$chosen_theme");
+ } else {
+ require($theme[0]["PATH"]);
+ }
+?>
\ No newline at end of file
include("../functions/display_messages.php");
include("../functions/imap.php");
+ include("../src/load_prefs.php");
+
echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
function putSelectedMessagesIntoString($msg) {
include("../functions/display_messages.php");
include("../functions/imap.php");
include("../functions/array.php");
- include("../functions/prefs.php");
+
+ include("../src/load_prefs.php");
+
echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
displayPageHeader($color, "None");
echo "<TABLE WIDTH=100% COLS=2 ALIGN=CENTER>\n";
// FULL NAME
echo " <TR>";
- echo " <TD WIDTH=20% ALIGN=RIGHT BGCOLOR=\"$color[0]\">";
+ echo " <TD WIDTH=20% ALIGN=RIGHT>";
echo " <FONT FACE=\"Arial,Helvetica\">";
echo " Full Name:";
echo " </FONT>";
echo " </TR>";
// REPLY-TO
echo " <TR>";
- echo " <TD WIDTH=20% ALIGN=RIGHT BGCOLOR=\"$color[0]\">";
+ echo " <TD WIDTH=20% ALIGN=RIGHT>";
echo " <FONT FACE=\"Arial,Helvetica\">";
echo " Reply-to:";
echo " </FONT>";
echo " </FONT>";
echo " </TD>";
echo " </TR>";
+ // THEME
+ echo " <TR>";
+ echo " <TD WIDTH=20% ALIGN=RIGHT>";
+ echo " <FONT FACE=\"Arial,Helvetica\">";
+ echo " Theme:";
+ echo " </FONT>";
+ echo " </TD>";
+ echo " <TD WIDTH=80% ALIGN=LEFT>";
+
+ echo " <TT><SELECT NAME=chosentheme>\n";
+ for ($i = 0; $i < count($theme); $i++) {
+ if ($theme[$i]["PATH"] == $chosen_theme)
+ echo " <OPTION SELECTED VALUE=\"".$theme[$i]["PATH"]."\">".$theme[$i]["NAME"]."\n";
+ else
+ echo " <OPTION VALUE=\"".$theme[$i]["PATH"]."\">".$theme[$i]["NAME"]."\n";
+ }
+ echo " </SELECT></TT>";
+ echo " </TD>";
+ echo " </TR>";
+
+ echo "</SELECT></TT>\n";
+
+
// SUBMIT BUTTON
echo " <TR>";
echo " <TD WIDTH=20%>";
echo " </TD>";
echo " <TD WIDTH=80% ALIGN=LEFT>";
- echo " <INPUT TYPE=SUBMIT VALUE=\"Submit\">\n";
+ echo " <BR><INPUT TYPE=SUBMIT VALUE=\"Submit\">\n";
echo " </TD>";
echo " </TR>";
include("../functions/display_messages.php");
include("../functions/imap.php");
include("../functions/array.php");
- include("../functions/prefs.php");
+
+ include("../src/load_prefs.php");
echo "<HTML>";
- 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";
displayPageHeader($color, "None");
setPref($username, "full_name", $full_name);
setPref($username, "reply_to", $reply_to);
+ setPref($username, "chosen_theme", $chosentheme);
echo "<FONT FACE=\"Arial,Helvetica\">";
echo "<BR><BR><BR><CENTER><B>Options Saved!</B><BR><BR>";
- echo "You will be automatically forwarded.<BR>If not, <A HREF=\"right_main.php\">click here</A>";
+ echo "Your options have been saved.<BR><A HREF=\"webmail.php\" TARGET=_top>Click here</A> to continue.";
echo "</CENTER></FONT>";
echo "</BODY></HTML>";
?>
\ No newline at end of file
include("../functions/mailbox.php");
include("../functions/date.php");
+ include("../src/load_prefs.php");
+
$imapConnection = loginToImapServer($username, $key, $imapServerAddress);
selectMailbox($imapConnection, $mailbox, $numMessages);
echo " </TD></TR>";
echo " <TR><TD BGCOLOR=\"$color[4]\" WIDTH=100%>\n";
- $body = formatBody($message);
+ $body = formatBody($message, $color);
echo "<BR>";
echo "$body";
include("../functions/mailbox_display.php");
include("../functions/display_messages.php");
+ include("../src/load_prefs.php");
+
echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
echo "<FONT FACE=\"Arial,Helvetica\">";
/////////////////////////////////////////////////////////////////////////////////
displayPageHeader($color, $mailbox);
// Get the list of messages for this mailbox
- showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort);
+ showMessagesForMailbox($imapConnection, $mailbox, $numMessages, $startMessage, $sort, $color);
// close the connection
fputs($imapConnection, "1 logout\n");
<HTML>
<?
include ("../config/config.php");
+ include("../src/load_prefs.php");
+
echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
echo "<BR><BR><TABLE BGCOLOR=\"$color[4]\" BORDER=0 COLS=1 WIDTH=50% CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>";
echo " <TR BGCOLOR=\"$color[3]\" WIDTH=100%>";