id) {echo "ajax failed";flush();exit();} $mailid=vtlib_purify($_REQUEST["mailid"]); if(isset($_REQUEST["mailbox"]) && $_REQUEST["mailbox"] != "") { $mailbox=vtlib_purify($_REQUEST["mailbox"]); } else { $mailbox="INBOX"; } $MailBox = new MailBox($mailbox); $mail = $MailBox->mbox; $email = new Webmails($MailBox->mbox,$mailid); $status=imap_setflag_full($MailBox->mbox,$mailid,"\\Seen"); $attach_tab=array(); $email->loadMail($attach_tab); echo "\n"; $subject = utf8_decode(utf8_encode(imap_utf8($email->subject))); $from = decode_header($email->from); $to = decode_header($email->to_header); $cc = decode_header($email->cc_header); $date = decode_header($email->date); for($i=0;$iattname);$i++){ $attachment_links .= $email->anchor_arr[$i].decode_header($email->attname[$i])."
                     "; } $content['body'] = $email->body; $content['attachtab'] = $email->attachtab; if(!$_REQUEST['fullview']) $class_str = 'class="tableHeadBg"'; else $class_str = 'style="font-size:15px"'; ?> width="100%" border="0" cellpadding="0" cellspacing="0">
 
 
 
 
 
 :
 
att; if(!$_REQUEST['fullview']) echo '
'; else echo '
'; echo $content['body']; //test added by Richie if (!isset($_REQUEST['display_images']) || $_REQUEST['display_images'] != 1) { $content['body'] = preg_replace('/src="[[:alpha:]]+:\/\/[^<>[:space:]]+[[:alnum:]\/]"/i', 'src="none"', $content['body']); $content['body'] = preg_replace('/src=[[:alpha:]]+:\/\/[^<>[:space:]]+[[:alnum:]\/]/i', 'src="none"', $content['body']); } //Display embedded HTML images $tmp_attach_tab=$content['attachtab']; $i = 0; $conf->display_img_attach = true; $conf->display_text_attach = true; while ($tmp = array_pop($tmp_attach_tab)) { if ($conf->display_img_attach && (preg_match("/image/i", $tmp['mime']) && ($tmp['number'] != ''))) { $exploded = explode('/', $tmp['mime']); $img_type = array_pop($exploded); if (preg_match("/JPEG/i", $img_type) || preg_match("/JPG/i", $img_type) || preg_match("/GIF/i", $img_type) || preg_match ('/PNG/i', $img_type)) { $new_img_src = 'src="get_img.php?mail=' . $mailid.'&num=' . $tmp['number'] . '&mime=' . $img_type . '&transfer=' . $tmp['transfer'] . '"'; $img_id = str_replace('<', '', $tmp['id']); $img_id = str_replace('>', '', $img_id); $content['body'] = str_replace('src="cid:'.$img_id.'"', $new_img_src, $content['body']); $content['body'] = str_replace('src=cid:'.$img_id, $new_img_src, $content['body']); } } } while ($tmp = array_pop($content['attachtab'])) { if ((!preg_match("/ATTACHMENT/i", $tmp['disposition'])) && $conf->display_text_attach && (preg_match("/text\/plain/i", $tmp['mime']))) echo '
'.view_part_detail($mail, $mailid, $tmp['number'], $tmp['transfer'], $tmp['charset'], $charset); if ($conf->display_img_attach && (preg_match("/image/i", $tmp['mime']) && ($tmp['number'] != ''))) { $exploded = explode('/', $tmp['mime']); $img_type = array_pop($exploded); if (preg_match("/JPEG/i", $img_type) || preg_match("/JPG/i", $img_type) || preg_match("/GIF/i", $img_type) || preg_match ('/PNG/g', $img_type)) { echo '
'; echo '
'; echo ''; echo '
'; } } } echo '
'; //test ended by Richie imap_close($MailBox->mbox); ?>