59177427 |
1 | <?php |
895905c0 |
2 | |
35586184 |
3 | /** |
4 | * read_body.php |
5 | * |
15e6162e |
6 | * Copyright (c) 1999-2002 The SquirrelMail Project Team |
35586184 |
7 | * Licensed under the GNU GPL. For full terms see the file COPYING. |
8 | * |
9 | * This file is used for reading the msgs array and displaying |
10 | * the resulting emails in the right frame. |
11 | * |
12 | * $Id$ |
a07cd1a4 |
13 | */ |
35586184 |
14 | |
15 | require_once('../src/validate.php'); |
16 | require_once('../functions/imap.php'); |
17 | require_once('../functions/mime.php'); |
18 | require_once('../functions/date.php'); |
19 | require_once('../functions/url_parser.php'); |
57257333 |
20 | require_once('../functions/smtp.php'); |
5be9f195 |
21 | |
a07cd1a4 |
22 | /** |
23 | * Given an IMAP message id number, this will look it up in the cached |
24 | * and sorted msgs array and return the index. Used for finding the next |
25 | * and previous messages. |
26 | * |
27 | * returns the index of the next valid message from the array |
28 | */ |
29 | function findNextMessage() { |
30 | global $msort, $currentArrayIndex, $msgs, $sort; |
31 | $result = -1; |
32 | |
33 | if ($sort == 6) { |
34 | if ($currentArrayIndex != 1) { |
35 | $result = $currentArrayIndex - 1; |
36 | } |
37 | } else { |
38 | for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) { |
39 | if ($currentArrayIndex == $msgs[$key]['ID']) { |
40 | next($msort); |
41 | $key = key($msort); |
42 | if (isset($key)) |
43 | $result = $msgs[$key]['ID']; |
44 | break; |
10f0ce72 |
45 | } |
46 | } |
10f0ce72 |
47 | } |
a07cd1a4 |
48 | return ($result); |
49 | } |
50 | |
51 | /** Removes just one address from the list of addresses. */ |
52 | function RemoveAddress(&$addr_list, $addr) { |
53 | if ($addr != '') { |
54 | foreach (array_keys($addr_list, $addr) as $key_to_delete) { |
55 | unset($addr_list[$key_to_delete]); |
10f0ce72 |
56 | } |
a07cd1a4 |
57 | } |
58 | } |
59 | |
60 | /** returns the index of the previous message from the array. */ |
61 | function findPreviousMessage() { |
57257333 |
62 | global $msort, $currentArrayIndex, $sort, $msgs, $imapConnection, |
63 | $mailbox, $data_dir, $username; |
64 | |
a07cd1a4 |
65 | $result = -1; |
66 | |
67 | if ($sort == 6) { |
68 | $numMessages = sqimap_get_num_messages($imapConnection, $mailbox); |
69 | if ($currentArrayIndex != $numMessages) { |
70 | $result = $currentArrayIndex + 1; |
71 | } |
72 | } else { |
73 | for (reset($msort); ($key = key($msort)), (isset($key)); next($msort)) { |
74 | if ($currentArrayIndex == $msgs[$key]['ID']) { |
75 | prev($msort); |
76 | $key = key($msort); |
77 | if (isset($key)) { |
78 | $result = $msgs[$key]['ID']; |
79 | break; |
10f0ce72 |
80 | } |
81 | } |
10f0ce72 |
82 | } |
a07cd1a4 |
83 | } |
84 | return ($result); |
85 | } |
10f0ce72 |
86 | |
a07cd1a4 |
87 | /** |
88 | * Displays a link to a page where the message is displayed more |
89 | * "printer friendly". |
90 | */ |
91 | function printer_friendly_link() { |
57257333 |
92 | global $passed_id, $mailbox, $ent_num, $color, |
93 | $pf_subtle_link, |
94 | $javascript_on; |
a07cd1a4 |
95 | |
96 | if (strlen(trim($mailbox)) < 1) { |
97 | $mailbox = 'INBOX'; |
98 | } |
10f0ce72 |
99 | |
57257333 |
100 | $params = '?passed_ent_id=' . $ent_num . |
101 | '&mailbox=' . urlencode($mailbox) . |
102 | '&passed_id=' . $passed_id; |
10f0ce72 |
103 | |
a07cd1a4 |
104 | $print_text = _("View Printable Version"); |
10f0ce72 |
105 | |
a07cd1a4 |
106 | if (!$pf_subtle_link) { |
107 | /* The link is large, on the bottom of the header panel. */ |
57257333 |
108 | $result = '<tr bgcolor="' . $color[0] . '">' . |
109 | '<td class="medText" align="right" valign="top">' . |
110 | ' ' . |
111 | '</td><td class="medText" valign="top" colspan="2">'."\n"; |
a07cd1a4 |
112 | } else { |
113 | /* The link is subtle, below "view full header". */ |
114 | $result = "<BR>\n"; |
115 | } |
10f0ce72 |
116 | |
a07cd1a4 |
117 | /* Output the link. */ |
118 | if ($javascript_on) { |
119 | $result .= '<script language="javascript">' . "\n" . |
120 | '<!--' . "\n" . |
121 | " function printFormat() {\n" . |
122 | ' window.open("../src/printer_friendly_main.php' . |
123 | $params . '","Print","width=800,height=600");' . "\n". |
124 | " }\n" . |
125 | "// -->\n" . |
126 | "</script>\n" . |
127 | "<A HREF=\"javascript:printFormat();\">$print_text</A>\n"; |
128 | } else { |
129 | $result .= '<A TARGET="_blank" HREF="../src/printer_friendly_bottom.php' . |
130 | "$params\">$print_text</A>\n"; |
131 | } |
10f0ce72 |
132 | |
a07cd1a4 |
133 | if (!$pf_subtle_link) { |
134 | /* The link is large, on the bottom of the header panel. */ |
57257333 |
135 | $result .= '</td></tr>' . "\n"; |
10f0ce72 |
136 | } |
137 | |
a07cd1a4 |
138 | return ($result); |
139 | } |
140 | |
57257333 |
141 | function ServerMDNSupport( $read ) { |
f69feefe |
142 | /* escaping $ doesn't work -> \x36 */ |
143 | $ret = preg_match( '/(\x36MDNSent|\\\*)/i', $read ); |
57257333 |
144 | return ( $ret ); |
145 | } |
146 | |
147 | function SendMDN ( $recipient , $sender) { |
148 | global $imapConnection, $mailbox, $username, $attachment_dir, $SERVER_NAME, |
149 | $version, $attachments, $identity, $data_dir, $passed_id; |
150 | |
99fbb343 |
151 | $header = sqimap_get_message_header($imapConnection, $passed_id, $mailbox); |
57257333 |
152 | $hashed_attachment_dir = getHashedDir($username, $attachment_dir); |
153 | |
154 | // part 1 (RFC2298) |
155 | |
156 | $senton = getLongDateString( $header->date ); |
157 | $to_array = $header->to; |
158 | $to = ''; |
159 | foreach ($to_array as $line) { |
160 | $to .= " $line "; |
161 | } |
162 | |
163 | $subject = $header->subject; |
164 | $now = getLongDateString( time() ); |
46bb8da8 |
165 | |
166 | $body = _("Your message") . "\r\n\r\n" . |
167 | "\t" . _("To:") . ' ' . $to . "\r\n" . |
168 | "\t" . _("Subject:") . ' ' . $subject . "\r\n" . |
169 | "\t" . _("Sent:") . ' ' . $senton . "\r\n" . |
170 | "\r\n" . |
171 | sprintf( _("Was displayed on %s"), $now ); |
f69feefe |
172 | |
57257333 |
173 | // part2 (RFC2298) |
174 | |
175 | $original_recipient = $to; |
176 | $original_message_id = $header->message_id; |
177 | |
178 | $part2 = "Reporting-UA : $SERVER_NAME ; SquirrelMail (version $version) \r\n"; |
179 | if ($original_recipient != '') { |
180 | $part2 .= "Original-Recipient : $original_recipient\r\n"; |
181 | } |
182 | $final_recipient = $sender; |
183 | $part2 .= "Final-Recipient: rfc822; $final_recipient\r\n" . |
184 | "Original-Message-ID : $original_message_id\r\n" . |
185 | "Disposition: manual-action/MDN-sent-manually; displayed\r\n"; |
186 | |
187 | |
188 | $localfilename = GenerateRandomString(32, 'FILE', 7); |
189 | $full_localfilename = "$hashed_attachment_dir/$localfilename"; |
190 | |
191 | $fp = fopen( $full_localfilename, 'w'); |
192 | fwrite ($fp, $part2); |
193 | fclose($fp); |
194 | |
195 | $newAttachment = array(); |
196 | $newAttachment['localfilename'] = $localfilename; |
197 | $newAttachment['type'] = "message/disposition-notification"; |
198 | |
199 | $attachments[] = $newAttachment; |
200 | $MDN_to = trim($recipient); |
201 | $reply_id = 0; |
202 | |
54817114 |
203 | return (SendMessage($MDN_to,'','', _("Read:") . ' ' . $subject, $body,$reply_id, True, 3) ); |
57257333 |
204 | } |
205 | |
206 | |
207 | function ToggleMDNflag ( $set ) { |
77b88425 |
208 | global $imapConnection, $passed_id, $mailbox; |
f69feefe |
209 | sqimap_mailbox_select($imapConnection, $mailbox); |
0892e427 |
210 | |
211 | $sg = $set?'+':'-'; |
212 | $cmd = 'STORE ' . $passed_id . ' ' . $sg . 'FLAGS ($MDNSent)'; |
0892e427 |
213 | $read = sqimap_run_command ($imapConnection, $cmd, true, $response, |
214 | $readmessage); |
57257333 |
215 | } |
216 | |
217 | function ClearAttachments() { |
218 | global $username, $attachments, $attachment_dir; |
219 | |
220 | $hashed_attachment_dir = getHashedDir($username, $attachment_dir); |
221 | |
222 | foreach ($attachments as $info) { |
223 | $attached_file = "$hashed_attachment_dir/$info[localfilename]"; |
224 | if (file_exists($attached_file)) { |
225 | unlink($attached_file); |
226 | } |
227 | } |
228 | |
229 | $attachments = array(); |
230 | } |
231 | |
232 | |
233 | /* |
234 | * Main of read_boby.php -------------------------------------------------- |
235 | */ |
236 | |
237 | /* |
238 | Urled vars |
239 | ---------- |
240 | $passed_id |
241 | */ |
a07cd1a4 |
242 | |
4366bea4 |
243 | if ( isset( $mailbox ) ) { |
244 | $mailbox = urldecode( $mailbox ); |
245 | } |
a07cd1a4 |
246 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); |
650be221 |
247 | $read = sqimap_mailbox_select($imapConnection, $mailbox, false, false, true); |
57257333 |
248 | |
a07cd1a4 |
249 | do_hook('html_top'); |
57257333 |
250 | |
251 | /* |
252 | * The following code sets necesarry stuff for the MDN thing |
253 | */ |
254 | if( $default_use_mdn && |
255 | ( $mdn_user_support = getPref($data_dir, $username, 'mdn_user_support', $default_use_mdn) ) ) { |
256 | |
f69feefe |
257 | $supportMDN = ServerMDNSupport($read["PERMANENTFLAGS"]); |
57257333 |
258 | $flags = sqimap_get_flags ($imapConnection, $passed_id); |
650be221 |
259 | $FirstTimeSee = !(in_array( 'Seen', $flags )); |
57257333 |
260 | } |
261 | |
a07cd1a4 |
262 | displayPageHeader($color, $mailbox); |
263 | |
57257333 |
264 | |
265 | /* |
266 | * The following code shows the header of the message and then exit |
267 | */ |
a07cd1a4 |
268 | if (isset($view_hdr)) { |
451a5790 |
269 | $read = sqimap_run_command ($imapConnection, "FETCH $passed_id BODY[HEADER]", true, $a, $b); |
a07cd1a4 |
270 | |
271 | echo '<BR>' . |
272 | '<TABLE WIDTH="100%" CELLPADDING="2" CELLSPACING="0" BORDER="0" ALIGN="CENTER">' . "\n" . |
273 | " <TR><TD BGCOLOR=\"$color[9]\" WIDTH=\"100%\"><CENTER><B>" . _("Viewing Full Header") . '</B> - '. |
274 | '<a href="' . $base_uri . "src/read_body.php?mailbox=".urlencode($mailbox); |
275 | if (isset($where) && isset($what)) { |
276 | // Got here from a search |
277 | echo "&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what).'">'; |
278 | } else { |
279 | echo "&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more\">"; |
280 | } |
57257333 |
281 | echo _("View message") . "</a></b></center></td></tr></table>\n" . |
282 | "<table width=\"99%\" cellpadding=2 cellspacing=0 border=0 align=center>\n" . |
283 | '<tr><td>'; |
a07cd1a4 |
284 | |
285 | $cnum = 0; |
286 | for ($i=1; $i < count($read); $i++) { |
287 | $line = htmlspecialchars($read[$i]); |
288 | if (eregi("^>", $line)) { |
289 | $second[$i] = $line; |
290 | $first[$i] = ' '; |
291 | $cnum++; |
292 | } else if (eregi("^[ |\t]", $line)) { |
293 | $second[$i] = $line; |
294 | $first[$i] = ''; |
295 | } else if (eregi("^([^:]+):(.+)", $line, $regs)) { |
296 | $first[$i] = $regs[1] . ':'; |
297 | $second[$i] = $regs[2]; |
298 | $cnum++; |
0606ca1f |
299 | } else { |
a07cd1a4 |
300 | $second[$i] = trim($line); |
301 | $first[$i] = ''; |
10f0ce72 |
302 | } |
a07cd1a4 |
303 | } |
304 | for ($i=0; $i < count($second); $i = $j) { |
305 | if (isset($first[$i])) { |
306 | $f = $first[$i]; |
0606ca1f |
307 | } |
a07cd1a4 |
308 | if (isset($second[$i])) { |
309 | $s = nl2br($second[$i]); |
310 | } |
311 | $j = $i + 1; |
312 | while (($first[$j] == '') && ($j < count($first))) { |
313 | $s .= ' ' . nl2br($second[$j]); |
314 | $j++; |
0606ca1f |
315 | } |
a07cd1a4 |
316 | parseEmail($s); |
317 | if (isset($f)) echo "<nobr><tt><b>$f</b>$s</tt></nobr>"; |
10f0ce72 |
318 | } |
57257333 |
319 | echo "</td></tr></table>\n" . |
320 | '</body></html>'; |
a07cd1a4 |
321 | sqimap_logout($imapConnection); |
322 | exit; |
323 | } |
324 | |
325 | if (isset($msgs)) { |
326 | $currentArrayIndex = $passed_id; |
327 | } else { |
328 | $currentArrayIndex = -1; |
329 | } |
330 | |
331 | for ($i = 0; $i < count($msgs); $i++) { |
332 | if ($msgs[$i]['ID'] == $passed_id) { |
333 | $msgs[$i]['FLAG_SEEN'] = true; |
10f0ce72 |
334 | } |
a07cd1a4 |
335 | } |
336 | |
337 | // $message contains all information about the message |
338 | // including header and body |
339 | $message = sqimap_get_message($imapConnection, $passed_id, $mailbox); |
340 | |
341 | /** translate the subject and mailbox into url-able text **/ |
342 | $url_subj = urlencode(trim($message->header->subject)); |
343 | $urlMailbox = urlencode($mailbox); |
344 | $url_replyto = ''; |
345 | if (isset($message->header->replyto)) { |
346 | $url_replyto = urlencode($message->header->replyto); |
347 | } |
348 | |
349 | $url_replytoall = $url_replyto; |
350 | |
351 | // If we are replying to all, then find all other addresses and |
352 | // add them to the list. Remove duplicates. |
353 | // This is somewhat messy, so I'll explain: |
354 | // 1) Take all addresses (from, to, cc) (avoid nasty join errors here) |
355 | $url_replytoall_extra_addrs = array_merge( |
356 | array($message->header->from), |
357 | $message->header->to, |
358 | $message->header->cc |
359 | ); |
360 | |
361 | // 2) Make one big string out of them |
362 | $url_replytoall_extra_addrs = join(';', $url_replytoall_extra_addrs); |
363 | |
364 | // 3) Parse that into an array of addresses |
365 | $url_replytoall_extra_addrs = parseAddrs($url_replytoall_extra_addrs); |
366 | |
367 | // 4) Make them unique -- weed out duplicates |
368 | // (Coded for PHP 4.0.0) |
369 | $url_replytoall_extra_addrs = |
370 | array_keys(array_flip($url_replytoall_extra_addrs)); |
371 | |
372 | // 5) Remove the addresses we'll be sending the message 'to' |
373 | $url_replytoall_avoid_addrs = ''; |
374 | if (isset($message->header->replyto)) { |
375 | $url_replytoall_avoid_addrs = $message->header->replyto; |
376 | } |
377 | |
378 | $url_replytoall_avoid_addrs = parseAddrs($url_replytoall_avoid_addrs); |
379 | foreach ($url_replytoall_avoid_addrs as $addr) { |
380 | RemoveAddress($url_replytoall_extra_addrs, $addr); |
381 | } |
382 | |
383 | // 6) Remove our identities from the CC list (they still can be in the |
384 | // TO list) only if $include_self_reply_all is turned off |
385 | if (!$include_self_reply_all) { |
386 | RemoveAddress($url_replytoall_extra_addrs, |
387 | getPref($data_dir, $username, 'email_address')); |
388 | $idents = getPref($data_dir, $username, 'identities'); |
389 | if ($idents != '' && $idents > 1) { |
390 | for ($i = 1; $i < $idents; $i ++) { |
391 | $cur_email_address = getPref($data_dir, $username, 'email_address' . $i); |
392 | RemoveAddress($url_replytoall_extra_addrs, $cur_email_address); |
10f0ce72 |
393 | } |
692155b7 |
394 | } |
a07cd1a4 |
395 | } |
1108e8bb |
396 | |
a07cd1a4 |
397 | // 7) Smoosh back into one nice line |
398 | $url_replytoallcc = getLineOfAddrs($url_replytoall_extra_addrs); |
692155b7 |
399 | |
a07cd1a4 |
400 | // 8) urlencode() it |
401 | $url_replytoallcc = urlencode($url_replytoallcc); |
be69e508 |
402 | |
a07cd1a4 |
403 | $dateString = getLongDateString($message->header->date); |
5bc39e3f |
404 | |
a07cd1a4 |
405 | // What do we reply to -- text only, if possible |
406 | $ent_num = findDisplayEntity($message); |
5bc39e3f |
407 | |
a07cd1a4 |
408 | /** TEXT STRINGS DEFINITIONS **/ |
409 | $echo_more = _("more"); |
410 | $echo_less = _("less"); |
411 | |
57257333 |
412 | if (!isset($show_more_cc)) { |
413 | $show_more_cc = FALSE; |
414 | } |
10f0ce72 |
415 | |
a07cd1a4 |
416 | /** FORMAT THE TO STRING **/ |
417 | $i = 0; |
418 | $to_string = ''; |
419 | $to_ary = $message->header->to; |
420 | while ($i < count($to_ary)) { |
421 | $to_ary[$i] = htmlspecialchars(decodeHeader($to_ary[$i])); |
422 | |
423 | if ($to_string) { |
424 | $to_string = "$to_string<BR>$to_ary[$i]"; |
425 | } else { |
426 | $to_string = "$to_ary[$i]"; |
10f0ce72 |
427 | } |
a07cd1a4 |
428 | |
429 | $i++; |
430 | if (count($to_ary) > 1) { |
431 | if ($show_more == false) { |
432 | if ($i == 1) { |
433 | /* From a search... */ |
434 | $to_string .= ' (<A HREF="' . $base_uri . |
435 | "src/read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&"; |
436 | if (isset($where) && isset($what)) { |
437 | $to_string .= 'where='.urlencode($where)."&what=".urlencode($what)."&show_more=1&show_more_cc=$show_more_cc\">$echo_more</A>)"; |
438 | } else { |
439 | $to_string .= "sort=$sort&startMessage=$startMessage&show_more=1&show_more_cc=$show_more_cc\">$echo_more</A>)"; |
440 | } |
441 | $i = count($to_ary); |
442 | } |
443 | } else if ($i == 1) { |
444 | /* From a search... */ |
445 | $to_string .= ' (<A HREF="' . $base_uri . |
446 | "src/read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&"; |
447 | if (isset($where) && isset($what)) { |
448 | $to_string .= 'where='.urlencode($where)."&what=".urlencode($what)."&show_more=0&show_more_cc=$show_more_cc\">$echo_less</A>)"; |
449 | } else { |
450 | $to_string .= "sort=$sort&startMessage=$startMessage&show_more=0&show_more_cc=$show_more_cc\">$echo_less</A>)"; |
10f0ce72 |
451 | } |
452 | } |
6dc0e464 |
453 | } |
a07cd1a4 |
454 | } |
455 | |
456 | /** FORMAT THE CC STRING **/ |
457 | $i = 0; |
458 | if (isset ($message->header->cc[0]) && trim($message->header->cc[0])) { |
459 | $cc_string = ""; |
460 | $cc_ary = $message->header->cc; |
461 | while ($i < count(decodeHeader($cc_ary))) { |
462 | $cc_ary[$i] = htmlspecialchars($cc_ary[$i]); |
463 | if ($cc_string) { |
464 | $cc_string = "$cc_string<BR>$cc_ary[$i]"; |
10f0ce72 |
465 | } else { |
a07cd1a4 |
466 | $cc_string = "$cc_ary[$i]"; |
10f0ce72 |
467 | } |
468 | |
469 | $i++; |
a07cd1a4 |
470 | if (count($cc_ary) > 1) { |
471 | if ($show_more_cc == false) { |
10f0ce72 |
472 | if ($i == 1) { |
473 | /* From a search... */ |
a07cd1a4 |
474 | $cc_string .= ' (<A HREF="' . $base_uri . |
475 | "src/read_body.php?mailbox=$urlMailbox&passed_id=$passed_id"; |
10f0ce72 |
476 | if (isset($where) && isset($what)) { |
a07cd1a4 |
477 | $cc_string .= '&what='.urlencode($what)."&where=".urlencode($where)."&show_more_cc=1&show_more=$show_more\">$echo_more</A>)"; |
10f0ce72 |
478 | } else { |
a07cd1a4 |
479 | $cc_string .= "&sort=$sort&startMessage=$startMessage&show_more_cc=1&show_more=$show_more\">$echo_more</A>)"; |
10f0ce72 |
480 | } |
a07cd1a4 |
481 | $i = count($cc_ary); |
10f0ce72 |
482 | } |
483 | } else if ($i == 1) { |
484 | /* From a search... */ |
a07cd1a4 |
485 | $cc_string .= ' (<A HREF="' . $base_uri . |
486 | "src/read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&"; |
10f0ce72 |
487 | if (isset($where) && isset($what)) { |
a07cd1a4 |
488 | $cc_string .= 'what=' . urlencode($what)."&where=".urlencode($where)."&show_more_cc=0&show_more=$show_more\">$echo_less</A>)"; |
10f0ce72 |
489 | } else { |
a07cd1a4 |
490 | $cc_string .= "sort=$sort&startMessage=$startMessage&show_more_cc=0&show_more=$show_more\">$echo_less</A>)"; |
10f0ce72 |
491 | } |
2844086d |
492 | } |
10f0ce72 |
493 | } |
494 | } |
a07cd1a4 |
495 | } |
9c3e6cd4 |
496 | else { |
497 | $cc_string = ''; |
498 | } |
a07cd1a4 |
499 | |
500 | /** FORMAT THE BCC STRING **/ |
501 | $i = 0; |
502 | if (isset ($message->header->bcc[0]) && trim($message->header->bcc[0])){ |
503 | $bcc_string = ""; |
504 | $bcc_ary = $message->header->bcc; |
505 | while ($i < count(decodeHeader($bcc_ary))) { |
506 | $bcc_ary[$i] = htmlspecialchars($bcc_ary[$i]); |
507 | if ($bcc_string) { |
508 | $bcc_string = "$bcc_string<BR>$bcc_ary[$i]"; |
509 | } else { |
510 | $bcc_string = "$bcc_ary[$i]"; |
10f0ce72 |
511 | } |
10f0ce72 |
512 | |
a07cd1a4 |
513 | $i++; |
514 | if (count($bcc_ary) > 1) { |
515 | if ($show_more_cc == false) { |
516 | if ($i == 1) { |
10f0ce72 |
517 | /* From a search... */ |
a07cd1a4 |
518 | $bcc_string .= ' (<A HREF="' . $base_uri . |
519 | "src/read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&"; |
10f0ce72 |
520 | if (isset($where) && isset($what)) { |
a07cd1a4 |
521 | $bcc_string .= 'what=' . urlencode($what)."&where=".urlencode($where)."&show_more_cc=1&show_more=$show_more\">$echo_more</A>)"; |
10f0ce72 |
522 | } else { |
a07cd1a4 |
523 | $bcc_string .= "sort=$sort&startMessage=$startMessage&show_more_cc=1&show_more=$show_more\">$echo_more</A>)"; |
524 | } |
525 | $i = count($bcc_ary); |
526 | } |
527 | } else if ($i == 1) { |
528 | /* From a search... */ |
529 | $bcc_string .= ' (<A HREF="' . $base_uri . |
530 | "src/read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&"; |
531 | if (isset($where) && isset($what)) { |
532 | $bcc_string .= 'what=' . urlencode($what)."&where=".urlencode($where)."&show_more_cc=0&show_more=$show_more\">$echo_less</A>)"; |
533 | } else { |
534 | $bcc_string .= "sort=$sort&startMessage=$startMessage&show_more_cc=0&show_more=$show_more\">$echo_less</A>)"; |
10f0ce72 |
535 | } |
536 | } |
537 | } |
538 | } |
a07cd1a4 |
539 | } |
9c3e6cd4 |
540 | else { |
541 | $bcc_string = ''; |
542 | } |
10f0ce72 |
543 | |
a07cd1a4 |
544 | if ($default_use_priority) { |
a7818e8e |
545 | $priority_level = substr($message->header->priority,0,1); |
546 | |
547 | switch($priority_level) { |
09278ebf |
548 | /* check for a higher then normal priority. */ |
549 | case '1': |
5be9f195 |
550 | case '2': |
551 | $priority_string = _("High"); |
09278ebf |
552 | break; |
553 | |
554 | /* check for a lower then normal priority. */ |
555 | case '4': |
5be9f195 |
556 | case '5': |
557 | $priority_string = _("Low"); |
09278ebf |
558 | break; |
5be9f195 |
559 | |
09278ebf |
560 | /* check for a normal priority. */ |
5be9f195 |
561 | case '3': |
09278ebf |
562 | default: |
563 | $priority_level = '3'; |
5be9f195 |
564 | $priority_string = _("Normal"); |
09278ebf |
565 | break; |
5be9f195 |
566 | |
10f0ce72 |
567 | } |
a07cd1a4 |
568 | } |
569 | |
570 | /** make sure everything will display in HTML format **/ |
571 | $from_name = decodeHeader(htmlspecialchars($message->header->from)); |
572 | $subject = decodeHeader(htmlspecialchars($message->header->subject)); |
573 | |
574 | do_hook('read_body_top'); |
575 | echo '<BR>' . |
57257333 |
576 | '<TABLE CELLSPACING="0" WIDTH="100%" BORDER="0" ALIGN="CENTER" CELLPADDING="0">' . |
577 | '<TR><TD BGCOLOR="' . $color[9] . '" WIDTH="100%">' . |
578 | '<TABLE WIDTH="100%" CELLSPACING="0" BORDER="0" CELLPADDING="3">' . |
579 | '<TR>' . |
580 | '<TD ALIGN="LEFT" WIDTH="33%">' . |
581 | '<SMALL>' . |
582 | '<A HREF="' . $base_uri . 'src/'; |
a07cd1a4 |
583 | |
584 | if ($where && $what) { |
585 | if( $pos == '' ) { |
586 | $pos = 0; |
10f0ce72 |
587 | } |
a07cd1a4 |
588 | echo "search.php?where$pos=".urlencode($where)."&pos=$pos&what$pos=".urlencode($what)."&mailbox=$urlMailbox\">"; |
589 | } else { |
5dd6c4d7 |
590 | echo "right_main.php?sort=$sort&startMessage=$startMessage&mailbox=$urlMailbox\">"; |
a07cd1a4 |
591 | } |
592 | echo _("Message List") . |
593 | '</A> | ' . |
594 | '<A HREF="' . $base_uri . "src/delete_message.php?mailbox=$urlMailbox&message=$passed_id&"; |
595 | if ($where && $what) { |
596 | echo 'where=' . urlencode($where) . '&what=' . urlencode($what) . '">'; |
597 | } else { |
598 | echo "sort=$sort&startMessage=$startMessage\">"; |
599 | } |
600 | echo _("Delete") . '</A> '; |
601 | if (($mailbox == $draft_folder) && ($save_as_draft)) { |
602 | echo '| <A HREF="' . $base_uri . |
9c3e6cd4 |
603 | "src/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\""; |
604 | if ($compose_new_win == '1') { |
605 | echo 'TARGET="compose_window" onClick="comp_in_new()"'; |
606 | } |
607 | echo '>'. |
a07cd1a4 |
608 | _("Resume Draft") . '</a>'; |
609 | } |
610 | |
611 | echo ' ' . |
57257333 |
612 | '</SMALL>' . |
613 | '</TD>' . |
614 | '<TD WIDTH="33%" ALIGN="CENTER">' . |
615 | '<SMALL>'; |
a07cd1a4 |
616 | |
617 | if ( !($where && $what) ) { |
618 | |
619 | if ($currentArrayIndex == -1) { |
620 | echo 'Previous | Next'; |
10f0ce72 |
621 | } else { |
a07cd1a4 |
622 | $prev = findPreviousMessage(); |
623 | $next = findNextMessage(); |
10f0ce72 |
624 | |
a07cd1a4 |
625 | if ($prev != -1) { |
626 | echo '<a href="' . $base_uri . "src/read_body.php?passed_id=$prev&mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage&show_more=0\">" . _("Previous") . "</A> | "; |
10f0ce72 |
627 | } else { |
a07cd1a4 |
628 | echo _("Previous") . ' | '; |
10f0ce72 |
629 | } |
7baf86a9 |
630 | |
a07cd1a4 |
631 | if ($next != -1) { |
632 | echo '<a href="' . $base_uri . "src/read_body.php?passed_id=$next&mailbox=$urlMailbox&sort=$sort&startMessage=$startMessage&show_more=0\">" . _("Next") . "</A>"; |
633 | } else { |
634 | echo _("Next"); |
635 | } |
10f0ce72 |
636 | } |
a07cd1a4 |
637 | } |
638 | |
57257333 |
639 | echo '</SMALL>' . |
640 | '</TD><TD WIDTH="33%" ALIGN="RIGHT">' . |
641 | '<SMALL>' . |
642 | '<A HREF="' . $base_uri . "src/compose.php?forward_id=$passed_id&forward_subj=$url_subj&". |
5dd6c4d7 |
643 | ($default_use_priority?"mailprio=$priority_level&":"") |
9c3e6cd4 |
644 | ."mailbox=$urlMailbox&ent_num=$ent_num\""; |
645 | if ($compose_new_win == '1') { |
646 | echo 'TARGET="compose_window" onClick="comp_in_new()"'; |
647 | } |
648 | echo '>'. |
a07cd1a4 |
649 | _("Forward") . |
650 | '</A> | ' . |
57257333 |
651 | '<A HREF="' . $base_uri . "src/compose.php?send_to=$url_replyto&reply_subj=$url_subj&". |
5dd6c4d7 |
652 | ($default_use_priority?"mailprio=$priority_level&":""). |
9c3e6cd4 |
653 | "reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\""; |
654 | if ($compose_new_win == '1') { |
655 | echo 'TARGET="compose_window" onClick="comp_in_new()"'; |
656 | } |
657 | echo '>'. |
a07cd1a4 |
658 | _("Reply") . |
659 | '</A> | ' . |
57257333 |
660 | '<A HREF="' . $base_uri . "src/compose.php?send_to=$url_replytoall&send_to_cc=$url_replytoallcc&reply_subj=$url_subj&". |
5dd6c4d7 |
661 | ($default_use_priority?"mailprio=$priority_level&":""). |
9c3e6cd4 |
662 | "reply_id=$passed_id&mailbox=$urlMailbox&ent_num=$ent_num\""; |
663 | if ($compose_new_win == '1') { |
664 | echo 'TARGET="compose_window" onClick="comp_in_new()"'; |
665 | } |
666 | echo '>'. |
a07cd1a4 |
667 | _("Reply All") . |
668 | '</A> ' . |
57257333 |
669 | '</SMALL>' . |
670 | '</TD>' . |
671 | '</TR>' . |
672 | '</TABLE>' . |
673 | '</TD></TR>' . |
674 | '<TR><TD CELLSPACING="0" WIDTH="100%">' . |
675 | '<TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="3">' . "\n" . |
676 | '<TR>' . "\n"; |
a07cd1a4 |
677 | |
678 | /** subject **/ |
57257333 |
679 | echo "<TD BGCOLOR=\"$color[0]\" WIDTH=\"10%\" ALIGN=\"right\" VALIGN=\"top\">\n" . |
a07cd1a4 |
680 | _("Subject:") . |
57257333 |
681 | "</TD><TD BGCOLOR=\"$color[0]\" WIDTH=\"80%\" VALIGN=\"top\">\n" . |
682 | "<B>$subject</B> \n" . |
683 | "</TD>\n" . |
684 | '<TD ROWSPAN="4" width="10%" BGCOLOR="' . $color[0] . |
a07cd1a4 |
685 | '" ALIGN=right VALIGN=top NOWRAP><small>'. |
686 | '<A HREF="' . $base_uri . "src/read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&"; |
687 | |
688 | /* From a search... */ |
689 | if ($where && $what) { |
690 | echo 'where=' . urlencode($where) . '&what=' . urlencode($what) . |
691 | "&view_hdr=1\">" . _("View Full Header") . "</A>\n"; |
692 | } else { |
693 | echo "startMessage=$startMessage&show_more=$show_more&view_hdr=1\">" . |
694 | _("View Full Header") . "</A>\n"; |
695 | } |
696 | |
697 | /* Output the printer friendly link if we are in subtle mode. */ |
698 | if ($pf_subtle_link) { |
699 | echo printer_friendly_link(true); |
700 | } |
701 | |
702 | do_hook("read_body_header_right"); |
57257333 |
703 | echo '</small></TD>' . |
704 | ' </TR>'; |
a07cd1a4 |
705 | |
706 | /** from **/ |
57257333 |
707 | echo '<TR>' . |
708 | '<TD BGCOLOR="' . $color[0] . '" ALIGN="RIGHT">' . |
a07cd1a4 |
709 | _("From:") . |
57257333 |
710 | '</TD><TD BGCOLOR="' . $color[0] . '">' . |
711 | "<B>$from_name</B> \n" . |
712 | '</TD>' . |
713 | '</TR>'; |
a07cd1a4 |
714 | /** date **/ |
57257333 |
715 | echo '<TR>' . "\n" . |
716 | '<TD BGCOLOR="' . $color[0] . '" ALIGN="RIGHT">' . "\n" . |
a07cd1a4 |
717 | _("Date:") . |
57257333 |
718 | "</TD><TD BGCOLOR=\"$color[0]\">\n" . |
719 | "<B>$dateString</B> \n" . |
720 | '</TD>' . "\n" . |
721 | '</TR>' . "\n"; |
a07cd1a4 |
722 | |
723 | /** to **/ |
57257333 |
724 | echo "<TR>\n" . |
725 | "<TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>\n" . |
a07cd1a4 |
726 | _("To:") . |
57257333 |
727 | '</TD><TD BGCOLOR="' . $color[0] . '" VALIGN="TOP">' . "\n" . |
728 | "<B>$to_string</B> \n" . |
729 | '</TD>' . "\n" . |
730 | '</TR>' . "\n"; |
a07cd1a4 |
731 | /** cc **/ |
9e9ad58b |
732 | if (isset($cc_string) && $cc_string <> '') { |
57257333 |
733 | echo '<TR>' . |
734 | "<TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>" . |
735 | 'Cc:' . |
736 | "</TD><TD BGCOLOR=\"$color[0]\" VALIGN=TOP colspan=2>" . |
737 | "<B>$cc_string</B> " . |
738 | '</TD>' . |
739 | '</TR>' . "\n"; |
a07cd1a4 |
740 | } |
741 | |
742 | /** bcc **/ |
9e9ad58b |
743 | if (isset($bcc_string) && $bcc_string <> '') { |
57257333 |
744 | echo '<TR>'. |
745 | "<TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>" . |
746 | 'Bcc:' . |
747 | "</TD><TD BGCOLOR=\"$color[0]\" VALIGN=TOP colspan=2>" . |
748 | "<B>$bcc_string</B> " . |
749 | '</TD>' . |
750 | '</TR>' . "\n"; |
a07cd1a4 |
751 | } |
9e9ad58b |
752 | if ($default_use_priority && isset($priority_string) && $priority_string <> '' ) { |
753 | echo '<TR>' . |
754 | "<TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>" . |
755 | _("Priority") . ': '. |
756 | "</TD><TD BGCOLOR=\"$color[0]\" VALIGN=TOP colspan=2>" . |
757 | "<B>$priority_string</B> " . |
758 | '</TD>' . |
759 | "</TR>" . "\n"; |
a07cd1a4 |
760 | } |
761 | |
762 | if ($show_xmailer_default) { |
451a5790 |
763 | $read = sqimap_run_command ($imapConnection, "FETCH $passed_id BODY.PEEK[HEADER.FIELDS (X-Mailer User-Agent)]", true, |
a07cd1a4 |
764 | $response, $readmessage); |
765 | $mailer = substr($read[1], strpos($read[1], " ")); |
766 | if (trim($mailer)) { |
57257333 |
767 | echo '<TR>' . |
768 | "<TD BGCOLOR=\"$color[0]\" ALIGN=RIGHT VALIGN=TOP>" . |
769 | _("Mailer") . ': '. |
770 | "</TD><TD BGCOLOR=\"$color[0]\" VALIGN=TOP colspan=2>" . |
771 | "<B>$mailer</B> " . |
772 | '</TD>' . |
773 | "</TR>" . "\n"; |
10f0ce72 |
774 | } |
a07cd1a4 |
775 | } |
776 | |
777 | /* Output the printer friendly link if we are not in subtle mode. */ |
778 | if (!$pf_subtle_link) { |
779 | echo printer_friendly_link(true); |
780 | } |
781 | |
57257333 |
782 | if ($default_use_mdn) { |
783 | if ($mdn_user_support) { |
784 | |
785 | // debug gives you the capability to remove mdn-flags |
e0e55568 |
786 | $MDNDebug = false; |
57257333 |
787 | $read = sqimap_run_command ($imapConnection, "FETCH $passed_id BODY.PEEK[HEADER.FIELDS (Disposition-Notification-To)]", true, |
788 | $response, $readmessage); |
789 | $MDN_to = substr($read[1], strpos($read[1], ' ')); |
790 | $MDN_flag_present = false; |
791 | |
792 | $read = sqimap_run_command ($imapConnection, "FETCH $passed_id FLAGS", true, |
793 | $response, $readmessage); |
77b88425 |
794 | |
795 | $MDN_flag_present = preg_match( '/.*\$MDNSent/i', $read[0]); |
796 | |
57257333 |
797 | if (trim($MDN_to) && |
798 | (!isset( $sendreceipt ) || $sendreceipt == '' ) ) { |
799 | |
800 | if ( $MDN_flag_present && $supportMDN) { |
77b88425 |
801 | $sendreceipt = 'removeMDN'; |
57257333 |
802 | $url = "\"read_body.php?mailbox=$mailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&sendreceipt=$sendreceipt\""; |
803 | $sendreceipt=""; |
650be221 |
804 | if ($MDNDebug ) { |
57257333 |
805 | echo '<TR>' . |
806 | "<TD BGCOLOR=\"$color[9]\" ALIGN=RIGHT VALIGN=TOP>" . |
807 | _("Read receipt") . ': ' . |
808 | "</TD><TD BGCOLOR=\"$color[9]\" VALIGN=TOP colspan=2>" . |
809 | '<B>' . |
810 | _("send") . |
811 | "</B> <a href=$url>[" . _("Remove MDN flag") . '] </a>' . |
812 | '</TD>' . |
813 | '</TR>' . "\n"; |
814 | } else { |
815 | echo '<TR>' . |
816 | "<TD BGCOLOR=\"$color[9]\" ALIGN=RIGHT VALIGN=TOP>" . |
817 | _("Read receipt") . ': ' . |
818 | "</TD><TD BGCOLOR=\"$color[9]\" VALIGN=TOP colspan=2>" . |
819 | '<B>'._("send").'</B>'. |
820 | '</TD>' . |
821 | '</TR>' . "\n"; |
822 | } |
823 | |
824 | } // when deleted or draft flag is set don't offer to send a MDN response |
f69feefe |
825 | else if ( ereg('\\Draft',$read[0] || ereg('\\Deleted',$read[0])) ) { |
57257333 |
826 | echo '<TR>' . |
827 | "<TD BGCOLOR=\"$color[9]\" ALIGN=RIGHT VALIGN=TOP>" . |
828 | _("Read receipt") . ': '. |
829 | "</TD><TD BGCOLOR=\"$color[9]\" VALIGN=TOP colspan=2>" . |
830 | '<B>' . _("requested") . "</B>" . |
831 | '</TD>' . |
832 | '</TR>' . "\n"; |
833 | } |
834 | // if no MDNsupport don't use the annoying popup messages |
835 | else if ( !$FirstTimeSee ) { |
836 | $sendreceipt = 'send'; |
837 | $url = "\"read_body.php?mailbox=$mailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&sendreceipt=$sendreceipt\""; |
838 | echo '<TR>' . |
839 | "<TD BGCOLOR=\"$color[9]\" ALIGN=RIGHT VALIGN=TOP>" . |
840 | _("Read receipt") . ': ' . |
841 | "</TD><TD BGCOLOR=\"$color[9]\" VALIGN=TOP colspan=2>" . |
842 | '<B>' . _("requested") . |
843 | "</B> <a href=$url>[" . _("Send read receipt now") . "]</a>" . |
844 | '</TD>' . |
845 | '</TR>' . "\n"; |
846 | $sendreceipt=''; |
847 | } |
848 | else { |
849 | $sendreceipt = 'send'; |
850 | $url = "\"read_body.php?mailbox=$mailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&sendreceipt=$sendreceipt\""; |
851 | if ($javascript_on) { |
852 | echo "<script language=\"javascript\"> \n" . |
853 | '<!-- ' . "\n" . |
854 | " if (window.confirm(\"" . |
855 | _("The message sender has requested a response to indicate that you have read this message. Would you like to send a receipt?") . |
856 | "\")) { \n" . |
857 | " window.location=($url); \n" . |
858 | ' window.reload()' . "\n" . |
859 | ' }' . "\n" . |
860 | '// -->' . "\n" . |
861 | '</script>' . "\n"; |
862 | } |
863 | echo '<TR>' . |
864 | "<TD BGCOLOR=\"$color[9]\" ALIGN=RIGHT VALIGN=TOP>" . |
865 | _("Read receipt") . ': ' . |
866 | "</TD><TD BGCOLOR=\"$color[9]\" VALIGN=TOP colspan=2>" . |
867 | '<B>' . _("requested") . "  </B><a href=$url>" . '[' . |
868 | _("Send read receipt now") . '] </a>' ." \n" . |
869 | '</TD>' . |
870 | '</TR>' . "\n"; |
871 | $sendreceipt = ''; |
872 | } |
873 | } |
874 | |
77b88425 |
875 | if ( !isset( $sendreceipt ) || $sendreceipt == '' ) { |
57257333 |
876 | } else if ( $sendreceipt == 'send' ) { |
877 | if ( !$MDN_flag_present) { |
878 | if (isset($identity) ) { |
77b88425 |
879 | $final_recipient = getPref($data_dir, $username, 'email_address' . '0', '' ); |
880 | } else { |
881 | $final_recipient = getPref($data_dir, $username, 'email_address', '' ); |
882 | } |
57257333 |
883 | |
884 | $final_recipient = trim($final_recipient); |
885 | if ($final_recipient == '' ) { |
77b88425 |
886 | $final_recipient = getPref($data_dir, $username, 'email_address', '' ); |
57257333 |
887 | } |
888 | |
77b88425 |
889 | if ( SendMDN( $MDN_to, $final_recipient ) > 0 && $supportMDN ) { |
890 | ToggleMDNflag( true); |
57257333 |
891 | } |
892 | } |
893 | $sendreceipt = 'removeMDN'; |
894 | $url = "\"read_body.php?mailbox=$mailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&sendreceipt=$sendreceipt\""; |
895 | $sendreceipt=""; |
896 | |
650be221 |
897 | if ($MDNDebug && $supportMDN) { |
57257333 |
898 | echo " <TR>\n" . |
899 | " <TD BGCOLOR=\"$color[9]\" ALIGN=RIGHT VALIGN=TOP>\n" . |
900 | " "._("Read receipt").": \n". |
901 | " </TD><TD BGCOLOR=\"$color[9]\" VALIGN=TOP colspan=2>\n" . |
902 | ' <B>'._("send").'</B>'." <a href=$url>" . '[' . _("Remove MDN flag") . '] </a>' . "\n" . |
903 | ' </TD>' . "\n" . |
904 | ' </TR>' . "\n"; |
905 | } else { |
906 | echo " <TR>\n" . |
907 | " <TD BGCOLOR=\"$color[9]\" ALIGN=RIGHT VALIGN=TOP>\n" . |
908 | " "._("Read receipt").": \n". |
909 | " </TD><TD BGCOLOR=\"$color[9]\" VALIGN=TOP colspan=2>\n" . |
910 | ' <B>'._("send").'</B>'. "\n" . |
911 | ' </TD>' . "\n" . |
912 | ' </TR>' . "\n"; |
913 | } |
914 | } |
915 | elseif ($sendreceipt == 'removeMDN' ) { |
916 | ToggleMDNflag ( false ); |
917 | |
918 | $sendreceipt = 'send'; |
919 | $url = "\"read_body.php?mailbox=$mailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&sendreceipt=$sendreceipt\""; |
920 | echo '<TR>'. |
921 | "<TD BGCOLOR=\"$color[9]\" ALIGN=RIGHT VALIGN=TOP>" . |
922 | _("Read receipt") . ': ' . |
923 | "</TD><TD BGCOLOR=\"$color[9]\" VALIGN=TOP colspan=2>" . |
924 | '<B>' . _("requested") . |
925 | "</B> <a href=$url>[" . _("Send read receipt now") . "]</a>" . |
926 | '</TD>' . |
927 | '</TR>' . "\n"; |
928 | $sendreceipt = ''; |
929 | |
930 | } |
931 | } |
932 | } |
933 | |
5be9f195 |
934 | do_hook('read_body_header'); |
57257333 |
935 | |
a07cd1a4 |
936 | echo '</TABLE>' . |
937 | ' </TD></TR>' . |
938 | '</TABLE>'; |
939 | flush(); |
5be9f195 |
940 | |
a07cd1a4 |
941 | echo "<TABLE CELLSPACING=0 WIDTH=\"97%\" BORDER=0 ALIGN=CENTER CELLPADDING=0>\n" . |
942 | " <TR><TD BGCOLOR=\"$color[4]\" WIDTH=\"100%\">\n" . |
943 | '<BR>'. |
944 | formatBody($imapConnection, $message, $color, $wrap_at). |
945 | '</TABLE>' . |
946 | '<TABLE CELLSPACING="0" WIDTH="100%" BORDER="0" ALIGN="CENTER" CELLPADDING="0">' . "\n" . |
947 | " <TR><TD BGCOLOR=\"$color[9]\"> </TD></TR>" . |
948 | '</TABLE>' . "\n"; |
949 | |
950 | /* show attached images inline -- if pref'fed so */ |
5be9f195 |
951 | if (($attachment_common_show_images) && |
a07cd1a4 |
952 | is_array($attachment_common_show_images_list)) { |
5be9f195 |
953 | |
a07cd1a4 |
954 | foreach ($attachment_common_show_images_list as $img) { |
5be9f195 |
955 | $imgurl = '../src/download.php' . |
57257333 |
956 | '?' . |
cd7b8833 |
957 | 'passed_id=' . urlencode($img['passed_id']) . |
958 | '&mailbox=' . urlencode($mailbox) . |
5be9f195 |
959 | '&passed_ent_id=' . urlencode($img['ent_id']) . |
960 | '&absolute_dl=true'; |
961 | |
a07cd1a4 |
962 | echo "<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER>\n" . |
57257333 |
963 | '<TR>' . |
964 | '<TD>' . |
965 | "<img src=\"$imgurl\">\n" . |
966 | "</TD>\n" . |
967 | "</TR>\n" . |
a07cd1a4 |
968 | "</TABLE>\n"; |
5be9f195 |
969 | |
10f0ce72 |
970 | } |
a07cd1a4 |
971 | } |
972 | |
5be9f195 |
973 | |
a07cd1a4 |
974 | do_hook('read_body_bottom'); |
975 | do_hook('html_bottom'); |
976 | sqimap_logout($imapConnection); |
977 | ?> |
978 | </body> |
a7818e8e |
979 | </html> |