$var['emaillistcc'] = str_replace(array('>', '<'), array('>', '<'), $var['emaillistcc']); } // Load the replyto field $var['EmailReplyTo'] = $email->replyto ? $email->replyto : $email->from; // If using IMAP, get the message flag from the ReadMsg.php module ( need to get it before the message for the correct flag ) if ($atmail->MailType == 'imap') { $MessageState = $email->MessageState; } else { $MessageState = $email->mail->getuidl($email->UIDL, $var['id']); } if ($email->txt) { $HTMLtoTextReply = $email->clean_html_to_text($email->txt); } else { $HTMLtoTextReply = $email->clean_html_to_text($email->html); } print $atmail->parse($var['filename'], array('id' => $var['id'], 'folder' => $var['folder'], 'folderstate' => str_replace(' ', '_', $var['folder']), 'EmailSubject' => cleanText($email->subject), 'EmailSubjectRaw' => $email->decode_htmlspecialchars($email->subject), 'EmailTo' => cleanText($email->ToSelect), 'EmailToList' => cleanText($var['emaillist']), 'EmailCc' => cleanText($email->CcSelect), 'EmailCcList' => cleanText($var['emaillistcc']), 'EmailFrom' => cleanText($email->from), 'EmailFromAddress' => cleanText($fromaddress), 'EmailAddress' => cleanText($email->emailfrom), 'EmailHtml' => ReadMsg::strip_style(cleanText($email->html)), 'EmailTxt' => cleanText($email->txt), 'EmailDate' => $email->date, 'EmailType' => $email->type, 'Virus' => $email->Virus, 'EmailPriority' => $email->priority, 'atmailstyle' => $var['atmailstyle'], 'Attachments' => $var['attachments'], 'print' => $var['print'], 'MailEncrypt' => $email->MailEncrypt, 'SmimeEncrypt' => $email->SmimeEncrypt, 'Encrypt' => $email->Encrypt, 'PgpPass' => $var['PgpPass'], 'EmailUIDL' => $email->UIDL, 'EmailCache' => $email->EmailCache, 'Charset' => $email->Charset, 'BlockImages' => $atmail->BlockImages, 'RawAttachments' => $var['rawattachments'], 'VideoMail' => $email->VideoMail, 'headers' => nl2br(cleanText($email->headers)), 'MessageState' => $MessageState, 'EmailReplyTo' => cleanText($var['EmailReplyTo']), 'ImageAttachments' => $var['image_attachments'], 'HTMLtoTextReply' => cleanText($HTMLtoTextReply))); // If mail account POP3/SQL or maildir, update the flag as read ( IMAP will do auto ) if ($atmail->MailType != 'imap') { $email->mail->updateuidl($email->UIDL, 'o', '', $var['folder'], $var['id']); } } $email->mail->quit(); $atmail->end(); function parse_attachments(&$obj) { global $var, $atmail; // Add links to download messages forwarded as // attachments (they are also displayed inline) foreach ($obj->attachedemails as $path) { if (!file_exists($path)) { continue;