| | |
| | | } |
| | | |
| | | $threading = (bool) $RCMAIL->storage->get_threading(); |
| | | $delimiter = $RCMAIL->storage->get_hierarchy_delimiter(); |
| | | |
| | | // set current mailbox and some other vars in client environment |
| | | $OUTPUT->set_env('mailbox', $mbox_name); |
| | | $OUTPUT->set_env('pagesize', $RCMAIL->storage->get_pagesize()); |
| | | $OUTPUT->set_env('delimiter', $RCMAIL->storage->get_hierarchy_delimiter()); |
| | | $OUTPUT->set_env('delimiter', $delimiter); |
| | | $OUTPUT->set_env('threading', $threading); |
| | | $OUTPUT->set_env('threads', $threading || $RCMAIL->storage->get_capability('THREAD')); |
| | | $OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0)); |
| | |
| | | 'movingmessage', 'copyingmessage', 'deletingmessage', 'markingmessage', |
| | | 'copy', 'move', 'quota'); |
| | | |
| | | $OUTPUT->set_pagetitle(rcmail_localize_foldername($RCMAIL->storage->mod_folder($mbox_name))); |
| | | $pagetitle = $RCMAIL->localize_foldername($RCMAIL->storage->mod_folder($mbox_name), true); |
| | | $pagetitle = str_replace($delimiter, " \xC2\xBB ", $pagetitle); |
| | | |
| | | $OUTPUT->set_pagetitle($pagetitle); |
| | | } |
| | | |
| | | /** |
| | |
| | | + $p + array('safe' => false, 'plain' => false, 'inline_html' => true)); |
| | | |
| | | // convert html to text/plain |
| | | if ($data['type'] == 'html' && $data['plain']) { |
| | | if ($data['plain'] && ($data['type'] == 'html' || $data['type'] == 'enriched')) { |
| | | if ($data['type'] == 'enriched') { |
| | | $data['body'] = rcube_enriched::to_html($data['body']); |
| | | } |
| | | $txt = new rcube_html2text($data['body'], false, true); |
| | | $body = $txt->get_text(); |
| | | $part->ctype_secondary = 'plain'; |
| | |
| | | $out .= html::div('message-partheaders', rcmail_message_headers(sizeof($header_attrib) ? $header_attrib : null, $part->headers)); |
| | | } |
| | | else if ($part->type == 'content') { |
| | | // unsapported |
| | | // unsupported (e.g. encrypted) |
| | | if ($part->realtype) { |
| | | if ($part->realtype == 'multipart/encrypted') { |
| | | if ($part->realtype == 'multipart/encrypted' || $part->realtype == 'application/pkcs7-mime') { |
| | | $out .= html::span('part-notice', rcube_label('encryptedmessage')); |
| | | } |
| | | continue; |
| | |
| | | $show_link = array( |
| | | 'href' => $MESSAGE->get_part_url($attach_prop->mime_id, false), |
| | | 'onclick' => sprintf( |
| | | 'return %s.command(\'load-attachment\',{part:\'%s\', mimetype:\'%s\'},this)', |
| | | 'return %s.command(\'load-attachment\',\'%s\',this)', |
| | | JS_OBJECT_NAME, |
| | | $attach_prop->mime_id, |
| | | $mimetype) |
| | | $attach_prop->mime_id) |
| | | ); |
| | | $out .= html::p('image-attachment', |
| | | html::a($show_link + array('class' => 'image-link', 'style' => sprintf('width:%dpx', $thumbnail_size)), |
| | |
| | | $mailto = $part['mailto']; |
| | | $string = $part['string']; |
| | | |
| | | // phishing email prevention (#1488981), e.g. "valid@email.addr <phishing@email.addr>" |
| | | if ($name && $name != $mailto && strpos($name, '@')) { |
| | | $name = ''; |
| | | } |
| | | |
| | | // IDNA ASCII to Unicode |
| | | if ($name == $mailto) |
| | | $name = rcube_idn_to_utf8($name); |
| | |
| | | $part = $MESSAGE->mime_parts[$part]; |
| | | $table = new html_table(array('cols' => 3)); |
| | | |
| | | $filename = $part->filename; |
| | | if (empty($filename) && $attach_prop->mimetype == 'text/html') { |
| | | $filename = rcube_label('htmlmessage'); |
| | | } |
| | | $filename = rcmail_attachment_name($part); |
| | | |
| | | if (!empty($filename)) { |
| | | $table->add('title', Q(rcube_label('filename'))); |
| | |
| | | |
| | | return $table->show($attrib); |
| | | } |
| | | |
| | | |
| | | |
| | | function rcmail_message_part_frame($attrib) |
| | |
| | | if ($agent = $RCMAIL->config->get('useragent')) |
| | | $headers['User-Agent'] = $agent; |
| | | |
| | | if ($RCMAIL->config->get('mdn_use_from')) |
| | | $options['mdn_use_from'] = true; |
| | | |
| | | $body = rcube_label("yourmessage") . "\r\n\r\n" . |
| | | "\t" . rcube_label("to") . ': ' . rcube_mime::decode_mime_string($message->headers->to, $message->headers->charset) . "\r\n" . |
| | | "\t" . rcube_label("subject") . ': ' . $message->subject . "\r\n" . |
| | |
| | | $compose->setTXTBody(rc_wordwrap($body, 75, "\r\n")); |
| | | $compose->addAttachment($report, 'message/disposition-notification', 'MDNPart2.txt', false, '7bit', 'inline'); |
| | | |
| | | $sent = rcmail_deliver_message($compose, $identity['email'], $mailto, $smtp_error, $body_file); |
| | | $sent = rcmail_deliver_message($compose, $identity['email'], $mailto, $smtp_error, $body_file, $options); |
| | | |
| | | if ($sent) |
| | | { |
| | |
| | | return $name; |
| | | } |
| | | |
| | | // return attachment filename, handle empty filename case |
| | | function rcmail_attachment_name($attachment, $display = false) |
| | | { |
| | | $filename = $attachment->filename; |
| | | |
| | | if ($filename === null || $filename === '') { |
| | | if ($attachment->mimetype == 'text/html') { |
| | | $filename = rcube_label('htmlmessage'); |
| | | } |
| | | else { |
| | | $ext = (array) rcube_mime::get_mime_extensions($attachment->mimetype); |
| | | $ext = array_shift($ext); |
| | | $filename = rcube_label('messagepart') . ' ' . $attachment->mime_id; |
| | | if ($ext) { |
| | | $filename .= '.' . $ext; |
| | | } |
| | | } |
| | | } |
| | | |
| | | $filename = preg_replace('[\r\n]', '', $filename); |
| | | |
| | | // Display smart names for some known mimetypes |
| | | if ($display) { |
| | | if (preg_match('/application\/(pgp|pkcs7)-signature/i', $attachment->mimetype)) { |
| | | $filename = rcube_label('digitalsig'); |
| | | } |
| | | } |
| | | |
| | | return $filename; |
| | | } |
| | | |
| | | function rcmail_search_filter($attrib) |
| | | { |
| | | global $OUTPUT, $CONFIG; |