Fixed bug #479867 - Turning Sqclock Off Not Working
[squirrelmail.git] / src / read_body.php
CommitLineData
59177427 1<?php
ef870322 2 /**
3 ** read_body.php
4 **
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
7 **
8 ** This file is used for reading the msgs array and displaying
9 ** the resulting emails in the right frame.
245a6892 10 **
11 ** $Id$
ef870322 12 **/
13
ff8a98e7 14 require_once('../src/validate.php');
15 require_once('../functions/imap.php');
16 require_once('../functions/mime.php');
17 require_once('../functions/date.php');
18 require_once('../functions/url_parser.php');
f740c049 19
c36ed9cf 20 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
21 sqimap_mailbox_select($imapConnection, $mailbox);
e5a06719 22 do_hook('html_top');
c36ed9cf 23 displayPageHeader($color, $mailbox);
24
245a6892 25 if (isset($view_hdr)) {
56a19f1e 26 fputs ($imapConnection, sqimap_session_id() . " FETCH $passed_id BODY[HEADER]\r\n");
27 $read = sqimap_read_data ($imapConnection, sqimap_session_id(), true, $a, $b);
c36ed9cf 28
56a19f1e 29 echo '<br>' .
30 '<table width="100%" cellpadding="2" cellspacing="0" border="0" align="center">' . "\n" .
31 " <TR><TD BGCOLOR=\"$color[9]\" WIDTH=100%><center><b>" . _("Viewing full header") . '</b> - ';
cd928157 32 if (isset($where) && isset($what)) {
f4991a86 33 // Got here from a search
e5a06719 34 echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what).'">';
8ae331c2 35 } else {
f4991a86 36 echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more\">";
37 }
56a19f1e 38 echo ''._("View message") . "</a></b></center></td></tr></table>\n" .
39 "<table width=99% cellpadding=2 cellspacing=0 border=0 align=center>\n" .
40 '<tr><td>';
5c54e435 41
cd928157 42 $cnum = 0;
8dd0db0b 43 for ($i=1; $i < count($read); $i++) {
5c54e435 44 $line = htmlspecialchars($read[$i]);
172fd718 45 if (eregi("^&gt;", $line)) {
46 $second[$i] = $line;
e5a06719 47 $first[$i] = '&nbsp;';
172fd718 48 $cnum++;
49 } else if (eregi("^[ |\t]", $line)) {
50 $second[$i] = $line;
e5a06719 51 $first[$i] = '';
172fd718 52 } else if (eregi("^([^:]+):(.+)", $line, $regs)) {
e5a06719 53 $first[$i] = $regs[1] . ':';
172fd718 54 $second[$i] = $regs[2];
55 $cnum++;
5c54e435 56 } else {
172fd718 57 $second[$i] = trim($line);
e5a06719 58 $first[$i] = '';
c36ed9cf 59 }
172fd718 60 }
61 for ($i=0; $i < count($second); $i = $j) {
cd928157 62 if (isset($first[$i]))
63 $f = $first[$i];
64 if (isset($second[$i]))
65 $s = nl2br($second[$i]);
172fd718 66 $j = $i + 1;
e5a06719 67 while ($first[$j] == '' && $j < count($first)) {
68 $s .= '&nbsp;&nbsp;&nbsp;&nbsp;' . nl2br($second[$j]);
172fd718 69 $j++;
70 }
71 parseEmail($s);
cd928157 72 if (isset($f)) echo "<nobr><tt><b>$f</b>$s</tt></nobr>";
c36ed9cf 73 }
5c54e435 74 echo "</td></tr></table>\n";
e5a06719 75 echo '</body></html>';
eabc2883 76 sqimap_logout($imapConnection);
c36ed9cf 77 exit;
78 }
79
90033b64 80 // given an IMAP message id number, this will look it up in the cached and sorted msgs array and
81 // return the index. used for finding the next and previous messages
82
83 // returns the index of the next valid message from the array
84 function findNextMessage() {
5c54e435 85 global $msort, $currentArrayIndex, $msgs, $sort;
86
87 if ($sort == 6) {
88 if ($currentArrayIndex != 1) {
89 return $currentArrayIndex - 1;
90 }
91 } else {
92 for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
26f1e4f1 93 if ($currentArrayIndex == $msgs[$key]['ID']) {
5c54e435 94 next($msort);
95 $key = key($msort);
96 if (isset($key))
e5a06719 97 return $msgs[$key]['ID'];
5c54e435 98 }
99 }
100 }
90033b64 101 return -1;
102 }
103
d6043e29 104 // Removes just one address from the list of addresses
105 function RemoveAddress(&$addr_list, $addr) {
106 if ($addr == '')
107 return;
108 foreach (array_keys($addr_list, $addr) as $key_to_delete)
109 {
110 unset($addr_list[$key_to_delete]);
111 }
112 }
113
114
90033b64 115 // returns the index of the previous message from the array
116 function findPreviousMessage() {
97876814 117 global $msort, $currentArrayIndex, $sort, $msgs, $imapConnection,
118 $mailbox, $data_dir, $username;
5c54e435 119 if ($sort == 6) {
120 $numMessages = sqimap_get_num_messages($imapConnection, $mailbox);
121 if ($currentArrayIndex != $numMessages) {
122 return $currentArrayIndex + 1;
123 }
124 } else {
125 for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) {
e5a06719 126 if ($currentArrayIndex == $msgs[$key]['ID']) {
5c54e435 127 prev($msort);
128 $key = key($msort);
129 if (isset($key))
e5a06719 130 return $msgs[$key]['ID'];
5c54e435 131 }
132 }
133 }
90033b64 134 return -1;
135 }
136
137 if (isset($msgs)) {
8ae331c2 138 $currentArrayIndex = $passed_id;
53524fa0 139 /*
90033b64 140 for ($i=0; $i < count($msgs); $i++) {
141 if ($msgs[$i]["ID"] == $passed_id) {
142 $currentArrayIndex = $i;
143 break;
144 }
145 }
53524fa0 146 */
90033b64 147 } else {
148 $currentArrayIndex = -1;
149 }
150
1108e8bb 151 for ($i = 0; $i < count($msgs); $i++) {
e5a06719 152 if ($msgs[$i]['ID'] == $passed_id)
153 $msgs[$i]['FLAG_SEEN'] = true;
1108e8bb 154 }
155
f7fb20fe 156 // $message contains all information about the message
157 // including header and body
813eba2f 158 $message = sqimap_get_message($imapConnection, $passed_id, $mailbox);
d51894be 159
f7fb20fe 160 /** translate the subject and mailbox into url-able text **/
d51894be 161 $url_subj = urlencode(trim($message->header->subject));
8467bf00 162 $urlMailbox = urlencode($mailbox);
541506f3 163 $url_replyto = '';
164 if (isset($message->header->replyto))
165 $url_replyto = urlencode($message->header->replyto);
be69e508 166
541506f3 167 $url_replytoall = $url_replyto;
5bc39e3f 168
169 // If we are replying to all, then find all other addresses and
170 // add them to the list. Remove duplicates.
171 // This is somewhat messy, so I'll explain:
172 // 1) Take all addresses (from, to, cc) (avoid nasty join errors here)
173 $url_replytoall_extra_addrs = array_merge(array($message->header->from),
174 $message->header->to, $message->header->cc);
175
176 // 2) Make one big string out of them
177 $url_replytoall_extra_addrs = join(';', $url_replytoall_extra_addrs);
178
179 // 3) Parse that into an array of addresses
180 $url_replytoall_extra_addrs = parseAddrs($url_replytoall_extra_addrs);
181
182 // 4) Make them unique -- weed out duplicates
40023540 183 // (Coded for PHP 4.0.0)
184 $url_replytoall_extra_addrs =
f4405199 185 array_keys(array_flip($url_replytoall_extra_addrs));
5bc39e3f 186
187 // 5) Remove the addresses we'll be sending the message 'to'
541506f3 188 $url_replytoall_avoid_addrs = '';
189 if (isset($message->header->replyto))
190 $url_replytoall_avoid_addrs = $message->header->replyto;
191 $url_replytoall_avoid_addrs = parseAddrs($url_replytoall_avoid_addrs);
5bc39e3f 192 foreach ($url_replytoall_avoid_addrs as $addr)
193 {
d6043e29 194 RemoveAddress($url_replytoall_extra_addrs, $addr);
195 }
196
197 // 6) Remove our identities from the CC list (they still can be in the
a13cf243 198 // TO list) only if $include_self_reply_all isn't set or it is ''.
199 if (getPref($data_dir, $username, 'include_self_reply_all') == '')
d6043e29 200 {
a13cf243 201 RemoveAddress($url_replytoall_extra_addrs,
202 getPref($data_dir, $username, 'email_address'));
203 $idents = getPref($data_dir, $username, 'identities');
204 if ($idents != '' && $idents > 1)
5bc39e3f 205 {
a13cf243 206 for ($i = 1; $i < $idents; $i ++)
207 {
208 RemoveAddress($url_replytoall_extra_addrs,
209 getPref($data_dir, $username, 'email_address' .
210 $i));
211 }
5bc39e3f 212 }
a13cf243 213 }
5bc39e3f 214
d6043e29 215 // 7) Smoosh back into one nice line
5bc39e3f 216 $url_replytoallcc = getLineOfAddrs($url_replytoall_extra_addrs);
217
d6043e29 218 // 8) urlencode() it
b676ba7e 219 $url_replytoallcc = urlencode($url_replytoallcc);
4bfed9f3 220
8beafbbc 221 $dateString = getLongDateString($message->header->date);
3ae6e629 222
223 // What do we reply to -- text only, if possible
429f8906 224 $ent_num = findDisplayEntity($message);
31f3d7c0 225
b581fa60 226 /** TEXT STRINGS DEFINITIONS **/
227 $echo_more = _("more");
228 $echo_less = _("less");
229
e788294e 230 if (!isset($show_more_cc)) $show_more_cc = false;
231
078a40a4 232 /** FORMAT THE TO STRING **/
2844086d 233 $i = 0;
e5a06719 234 $to_string = '';
8beafbbc 235 $to_ary = $message->header->to;
2844086d 236 while ($i < count($to_ary)) {
99fa2b21 237 $to_ary[$i] = htmlspecialchars(decodeHeader($to_ary[$i]));
be8e07f8 238
2844086d 239 if ($to_string)
240 $to_string = "$to_string<BR>$to_ary[$i]";
241 else
242 $to_string = "$to_ary[$i]";
243
244 $i++;
245 if (count($to_ary) > 1) {
246 if ($show_more == false) {
247 if ($i == 1) {
30833080 248 if (isset($where) && isset($what)) {
f4991a86 249 // from a search
250 $to_string = "$to_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."&show_more=1&show_more_cc=$show_more_cc\">$echo_more</A>)";
251 } else {
252 $to_string = "$to_string&nbsp;(<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>)";
253 }
2844086d 254 $i = count($to_ary);
255 }
256 } else if ($i == 1) {
30833080 257 if (isset($where) && isset($what)) {
f4991a86 258 // from a search
259 $to_string = "$to_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."&show_more=0&show_more_cc=$show_more_cc\">$echo_less</A>)";
260 } else {
261 $to_string = "$to_string&nbsp;(<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>)";
262 }
2844086d 263 }
264 }
265 }
266
078a40a4 267 /** FORMAT THE CC STRING **/
268 $i = 0;
e7681707 269 if (isset ($message->header->cc[0]) && trim($message->header->cc[0])){
270 $cc_string = "";
271 $cc_ary = $message->header->cc;
272 while ($i < count(decodeHeader($cc_ary))) {
273 $cc_ary[$i] = htmlspecialchars($cc_ary[$i]);
274 if ($cc_string)
275 $cc_string = "$cc_string<BR>$cc_ary[$i]";
276 else
277 $cc_string = "$cc_ary[$i]";
278
279 $i++;
280 if (count($cc_ary) > 1) {
281 if ($show_more_cc == false) {
282 if ($i == 1) {
30833080 283 if (isset($where) && isset($what)) {
e7681707 284 // from a search
285 $cc_string = "$cc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&what=".urlencode($what)."&where=".urlencode($where)."&show_more_cc=1&show_more=$show_more\">$echo_more</A>)";
286 } else {
287 $cc_string = "$cc_string&nbsp;(<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>)";
288 }
289 $i = count($cc_ary);
290 }
291 } else if ($i == 1) {
30833080 292 if (isset($where) && isset($what)) {
f4991a86 293 // from a search
e7681707 294 $cc_string = "$cc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&what=".urlencode($what)."&where=".urlencode($where)."&show_more_cc=0&show_more=$show_more\">$echo_less</A>)";
f4991a86 295 } else {
e7681707 296 $cc_string = "$cc_string&nbsp;(<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>)";
f4991a86 297 }
078a40a4 298 }
078a40a4 299 }
300 }
301 }
853b543d 302 /** FORMAT THE BCC STRING **/
303 $i = 0;
304 if (isset ($message->header->bcc[0]) && trim($message->header->bcc[0])){
305 $bcc_string = "";
306 $bcc_ary = $message->header->bcc;
307 while ($i < count(decodeHeader($bcc_ary))) {
308 $bcc_ary[$i] = htmlspecialchars($bcc_ary[$i]);
309 if ($bcc_string)
310 $bcc_string = "$bcc_string<BR>$bcc_ary[$i]";
311 else
312 $bcc_string = "$bcc_ary[$i]";
313
314 $i++;
315 if (count($bcc_ary) > 1) {
316 if ($show_more_cc == false) {
317 if ($i == 1) {
318 if (isset($where) && isset($what)) {
319 // from a search
320 $bcc_string = "$bcc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&what=".urlencode($what)."&where=".urlencode($where)."&show_more_cc=1&show_more=$show_more\">$echo_more</A>)";
321 } else {
322 $bcc_string = "$bcc_string&nbsp;(<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>)";
323 }
324 $i = count($bcc_ary);
325 }
326 } else if ($i == 1) {
327 if (isset($where) && isset($what)) {
328 // from a search
329 $bcc_string = "$bcc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&what=".urlencode($what)."&where=".urlencode($where)."&show_more_cc=0&show_more=$show_more\">$echo_less</A>)";
330 } else {
331 $bcc_string = "$bcc_string&nbsp;(<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>)";
332 }
333 }
334 }
335 }
336 }
020abcf3 337
338 if($default_use_priority) {
339 switch(substr($message->header->priority,0,1)) {
340 case "1" : $priority_string = _("High");
341 break;
342 case "3" : $priority_string = _("Normal");
343 break;
344 case "5" : $priority_string = _("Low");
345 break;
346 }
347 }
f7fb20fe 348 /** make sure everything will display in HTML format **/
8beafbbc 349 $from_name = decodeHeader(htmlspecialchars($message->header->from));
7aaa81fc 350 $subject = decodeHeader(htmlspecialchars($message->header->subject));
078a40a4 351
e5a06719 352 do_hook('read_body_top');
56a19f1e 353 echo '<BR>' .
354 '<TABLE CELLSPACING="0" WIDTH="100%" BORDER="0" ALIGN="CENTER" CELLPADDING="0">' . "\n" .
f7b1b3b1 355 ' <TR><TD BGCOLOR="' . $color[9] . '" WIDTH="100%">' . "\n" .
356 ' <TABLE WIDTH="100%" CELLSPACING="0" BORDER="0" CELLPADDING="3">' . "\n" .
357 ' <TR>' . "\n" .
358 ' <TD ALIGN="LEFT" WIDTH="33%">' . "\n" .
359 ' <SMALL>' . "\n";
1809bad8 360 if ($where && $what) {
361 echo " <A HREF=\"search.php?where=".urlencode($where)."&what=".urlencode($what)."&mailbox=$urlMailbox\">";
362 } else {
363 echo " <A HREF=\"right_main.php?use_mailbox_cache=1&sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">";
364 }
b581fa60 365 echo _("Message List");
e5a06719 366 echo '</A>&nbsp;|&nbsp;';
1809bad8 367 if ($where && $what) {
e5a06719 368 echo " <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&where=".urlencode($where)."&what=".urlencode($what).'">';
1809bad8 369 } else {
d36f3e63 370 echo " <A HREF=\"delete_message.php?mailbox=$urlMailbox&message=$passed_id&sort=$sort&startMessage=$startMessage\">";
1809bad8 371 }
f7b1b3b1 372 echo _("Delete") . '</A>&nbsp;';
00b49b9e 373 if (($mailbox == $draft_folder) && ($save_as_draft)) {
374 echo '|&nbsp;';
0eed445e 375 echo " <A HREF=\"compose.php?mailbox=$mailbox&send_to=$to_string&send_to_cc=$cc_string&send_to_bcc=$bcc_string&subject=$url_subj&draft_id=$passed_id&ent_num=$ent_num\">";
f7b1b3b1 376 echo _("Resume Draft") . '</a>';
00b49b9e 377 }
378 echo '&nbsp;&nbsp;' .
56a19f1e 379 ' </SMALL>' .
380 ' </TD><TD WIDTH="33%" ALIGN="CENTER">' .
381 ' <SMALL>' . "\n";
f7b1b3b1 382
1809bad8 383 if ($where && $what) {
90033b64 384 } else {
1809bad8 385 if ($currentArrayIndex == -1) {
e5a06719 386 echo 'Previous&nbsp;|&nbsp;Next';
1809bad8 387 } else {
388 $prev = findPreviousMessage();
389 $next = findNextMessage();
390 if ($prev != -1)
391 echo "<a href=\"read_body.php?passed_id=$prev&mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage&show_more=0\">" . _("Previous") . "</A>&nbsp;|&nbsp;";
392 else
e5a06719 393 echo _("Previous") . '&nbsp;|&nbsp;';
1809bad8 394 if ($next != -1)
395 echo "<a href=\"read_body.php?passed_id=$next&mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage&show_more=0\">" . _("Next") . "</A>";
396 else
397 echo _("Next");
398 }
399 }
56a19f1e 400 echo ' </SMALL>' . "\n" .
401 ' </TD><TD WIDTH="33%" ALIGN="RIGHT">' .
402 ' <SMALL>' .
403 " <A HREF=\"compose.php?forward_id=$passed_id&forward_subj=$url_subj&mailbox=$urlMailbox&ent_num=$ent_num\">" .
404 _("Forward") .
405 '</A>&nbsp;|&nbsp;' .
406 " <A HREF=\"compose.php?send_to=$url_replyto&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\">" .
407 _("Reply") .
408 '</A>&nbsp;|&nbsp;' .
409 " <A HREF=\"compose.php?send_to=$url_replytoall&send_to_cc=$url_replytoallcc&reply_subj=$url_subj&reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\">" .
410 _("Reply All") .
411 '</A>&nbsp;&nbsp;' .
412 ' </SMALL>' .
413 ' </TD>' .
414 ' </TR>' .
415 ' </TABLE>' .
416 ' </TD></TR>' .
417 ' <TR><TD CELLSPACING="0" WIDTH="100%">' .
418 ' <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="3">' . "\n" .
419 ' <TR>' . "\n" .
be69e508 420 /** subject **/
56a19f1e 421 " <TD BGCOLOR=\"$color[0]\" WIDTH=\"10%\" ALIGN=\"right\" VALIGN=\"top\">\n" .
422 _("Subject:") .
423 " </TD><TD BGCOLOR=\"$color[0]\" WIDTH=\"80%\" VALIGN=\"top\">\n" .
424 " <B>$subject</B>&nbsp;\n" .
425 " </TD>\n" .
426 ' <TD ROWSPAN="4" width=10% BGCOLOR="'.$color[0].'" ALIGN=right VALIGN=top NOWRAP><small>' . "\n";
f4991a86 427 if ($where && $what) {
428 // Got here from a search
d7e6f0c4 429 echo "<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."&view_hdr=1\">" . _("View full header") . "</a>\n";
9736fafe 430 } else {
d7e6f0c4 431 echo "<a href=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&view_hdr=1\">" . _("View full header") . "</a>\n";
f4991a86 432 }
9736fafe 433 do_hook("read_body_header_right");
56a19f1e 434 echo '</small></TD>' . "\n" .
435 ' </TR>' ."\n" .
be69e508 436 /** from **/
56a19f1e 437 ' <TR>' . "\n" .
438 ' <TD BGCOLOR="' . $color[0] . '" ALIGN="RIGHT">' . "\n" .
439 _("From:") .
440 ' </TD><TD BGCOLOR="' . $color[0] . '">' . "\n" .
441 " <B>$from_name</B>&nbsp;\n" .
442 ' </TD>' . "\n" .
443 ' </TR>' . "\n" .
be69e508 444 /** date **/
56a19f1e 445 ' <TR>' . "\n" .
446 ' <TD BGCOLOR="' . $color[0] . '" ALIGN="RIGHT">' . "\n" .
447 _("Date:") .
448 " </TD><TD BGCOLOR=\"$color[0]\">\n" .
449 " <B>$dateString</B>&nbsp;\n" .
450 ' </TD>' . "\n" .
451 ' </TR>' . "\n" .
2844086d 452 /** to **/
56a19f1e 453 " <TR>\n" .
454 " <TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>\n" .
455 _("To:") .
456 ' </TD><TD BGCOLOR="' . $color[0] . '" VALIGN="TOP">' . "\n" .
457 " <B>$to_string</B>&nbsp;\n" .
458 ' </TD>' . "\n" .
459 ' </TR>' . "\n";
078a40a4 460 /** cc **/
e7681707 461 if (isset($cc_string)) {
56a19f1e 462 echo " <TR>\n" .
463 " <TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>\n" .
464 ' Cc:' . "\n" .
465 " </TD><TD BGCOLOR=\"$color[0]\" VALIGN=TOP colspan=2>\n" .
466 " <B>$cc_string</B>&nbsp;\n" .
467 ' </TD>' . "\n" .
468 ' </TR>' . "\n";
078a40a4 469 }
853b543d 470 /** bcc **/
471 if (isset($bcc_string)) {
472 echo " <TR>\n" .
473 " <TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>\n" .
474 ' Bcc:' . "\n" .
475 " </TD><TD BGCOLOR=\"$color[0]\" VALIGN=TOP colspan=2>\n" .
476 " <B>$bcc_string</B>&nbsp;\n" .
477 ' </TD>' . "\n" .
478 ' </TR>' . "\n";
479 }
020abcf3 480 if ($default_use_priority) {
481 if (isset($priority_string)) {
482 echo " <TR>\n" .
483 " <TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>\n" .
484 " "._("Priority").": \n".
485 " </TD><TD BGCOLOR=\"$color[0]\" VALIGN=TOP colspan=2>\n" .
486 " <B>$priority_string</B>&nbsp;\n" .
487 " </TD>" . "\n" .
488 " </TR>" . "\n";
489 }
490 }
cc24badd 491 do_hook("read_body_header");
56a19f1e 492 echo '</TABLE>' .
493 ' </TD></TR>' .
f2ac56af 494 '</table>';
495 flush();
496 echo "<TABLE CELLSPACING=0 WIDTH=97% BORDER=0 ALIGN=CENTER CELLPADDING=0>\n" .
56a19f1e 497 " <TR><TD BGCOLOR=\"$color[4]\" WIDTH=100%>\n" .
498 '<BR>';
9297917e 499
500 $body = formatBody($imapConnection, $message, $color, $wrap_at);
5c55c295 501
56a19f1e 502 echo $body .
503 '</TABLE>' .
504 '<TABLE CELLSPACING="0" WIDTH="100%" BORDER="0" ALIGN="CENTER" CELLPADDING="0">' . "\n" .
505 " <TR><TD BGCOLOR=\"$color[9]\">&nbsp;</TD></TR>" .
506 '</TABLE>' . "\n";
be69e508 507
e5a06719 508 do_hook('read_body_bottom');
509 do_hook('html_bottom');
1195c340 510 sqimap_logout($imapConnection);
00b49b9e 511?>