dc0d9952ab8a8861e161b3d2bd03d8112bc2c5a4
4 if (!isset($config_php))
5 include("../config/config.php");
6 if (!isset($strings_php))
7 include("../functions/strings.php");
8 if (!isset($page_header_php))
9 include("../functions/page_header.php");
10 if (!isset($imap_php))
11 include("../functions/imap.php");
12 if (!isset($mime_php))
13 include("../functions/mime.php");
14 if (!isset($date_php))
15 include("../functions/date.php");
17 include("../src/load_prefs.php");
19 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
20 sqimap_mailbox_select($imapConnection, $mailbox);
22 // $message contains all information about the message
23 // including header and body
24 $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
27 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
28 displayPageHeader($color, $mailbox);
30 /** translate the subject and mailbox into url-able text **/
31 $url_subj = urlencode(trim(stripslashes($message["HEADER"]["SUBJECT"])));
32 $urlMailbox = urlencode($mailbox);
33 $url_replyto = urlencode($message["HEADER"]["REPLYTO"]);
35 $url_replytoall = urlencode($message["HEADER"]["REPLYTO"]);
36 $url_replytoallcc = urlencode(getLineOfAddrs($message["HEADER"]["TO"]) . ", " . getLineOfAddrs($message["HEADER"]["CC"]));
38 $dateString = getLongDateString($message["HEADER"]["DATE"]);
40 /** TEXT STRINGS DEFINITIONS **/
41 $echo_more = _("more");
42 $echo_less = _("less");
44 /** FORMAT THE TO STRING **/
47 $to_ary = $message["HEADER"]["TO"];
48 while ($i < count($to_ary)) {
49 $to_ary[$i] = htmlspecialchars($to_ary[$i]);
51 $to_string = "$to_string<BR>$to_ary[$i]";
53 $to_string = "$to_ary[$i]";
56 if (count($to_ary) > 1) {
57 if ($show_more == false) {
59 $to_string = "$to_string (<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more=1&show_more_cc=$show_more_cc\">$echo_more</A>)";
63 $to_string = "$to_string (<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more=0&show_more_cc=$show_more_cc\">$echo_less</A>)";
68 /** FORMAT THE CC STRING **/
71 $cc_ary = $message["HEADER"]["CC"];
72 while ($i < count($cc_ary)) {
73 $cc_ary[$i] = htmlspecialchars($cc_ary[$i]);
75 $cc_string = "$cc_string<BR>$cc_ary[$i]";
77 $cc_string = "$cc_ary[$i]";
80 if (count($cc_ary) > 1) {
81 if ($show_more_cc == false) {
83 $cc_string = "$cc_string (<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=1&show_more=$show_more\">$echo_more</A>)";
87 $cc_string = "$cc_string (<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=0&show_more=$show_more\">$echo_less</A>)";
92 /** make sure everything will display in HTML format **/
93 $from_name = decodeHeader(htmlspecialchars($message["HEADER"]["FROM"]));
94 $subject = decodeHeader(htmlspecialchars(stripslashes($message["HEADER"]["SUBJECT"])));
97 echo "<TABLE COLS=1 CELLSPACING=0 WIDTH=98% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n";
98 echo " <TR><TD BGCOLOR=\"$color[0]\" WIDTH=100%>";
99 echo " <TABLE WIDTH=100% CELLSPACING=0 BORDER=0 COLS=2 CELLPADDING=3>";
101 echo " <TD ALIGN=LEFT WIDTH=50%>";
103 echo " <A HREF=\"right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">";
104 echo _("Message List");
105 echo "</A> | ";
106 echo " <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=1\">";
108 echo "</A> ";
110 echo " </TD><TD WIDTH=50% ALIGN=RIGHT>";
112 echo " <A HREF=\"compose.php?forward_id=$passed_id&forward_subj=$url_subj&mailbox=$urlMailbox\">";
114 echo "</A> | ";
115 echo " <A HREF=\"compose.php?send_to=$url_replyto&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">";
117 echo "</A> | ";
118 echo " <A HREF=\"compose.php?send_to=$url_replytoall&send_to_cc=$url_replytoallcc&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox\">";
120 echo "</A> ";
126 echo " <TR><TD CELLSPACING=0 WIDTH=100%>";
127 echo " <TABLE COLS=2 WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=3>\n";
130 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT>\n";
132 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85%>\n";
133 echo " <B>$subject</B>\n";
138 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT>\n";
140 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85%>\n";
141 echo " <B>$from_name</B>\n";
146 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT>\n";
148 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85%>\n";
149 echo " <B>$dateString</B>\n";
154 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT VALIGN=TOP>\n";
156 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85% VALIGN=TOP>\n";
157 echo " <B>$to_string</B>\n";
161 if ($message["HEADER"]["CC"][0]) {
163 echo " <TD BGCOLOR=\"$color[4]\" WIDTH=15% ALIGN=RIGHT VALIGN=TOP>\n";
165 echo " </TD><TD BGCOLOR=\"$color[4]\" WIDTH=85% VALIGN=TOP>\n";
166 echo " <B>$cc_string</B>\n";
173 echo " <TR><TD BGCOLOR=\"$color[4]\" WIDTH=100%>\n";
174 $body = formatBody($message, $color, $wrap_at);
179 echo " </TD></TR>\n";
180 echo " <TR><TD BGCOLOR=\"$color[9]\"> </TD></TR>";