| | |
| | | // go back to list if message not found (wrong UID) |
| | | if (empty($MESSAGE->headers)) { |
| | | $OUTPUT->show_message('messageopenerror', 'error'); |
| | | if ($RCMAIL->action=='preview' && template_exists('messagepreview')) |
| | | if ($RCMAIL->action=='preview' && $OUTPUT->template_exists('messagepreview')) |
| | | $OUTPUT->send('messagepreview'); |
| | | else { |
| | | $RCMAIL->action = 'list'; |
| | | rcmail_overwrite_action(''); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | $mbox_name = $IMAP->get_mailbox_name(); |
| | | |
| | | // calculate Etag for this request |
| | | $etag = md5($MESSAGE->uid.$mbox_name.session_id().intval($MESSAGE->headers->mdn_sent).intval($MESSAGE->is_safe).intval($PRINT_MODE)); |
| | | |
| | | // check known senders to display images |
| | | if (!$MESSAGE->is_safe |
| | | && !empty($MESSAGE->sender['mailto']) |
| | |
| | | $MESSAGE->set_safe(true); |
| | | } |
| | | } |
| | | |
| | | // calculate Etag for this request |
| | | $etag = md5($MESSAGE->uid.$mbox_name.session_id().intval($MESSAGE->headers->mdn_sent).intval($MESSAGE->is_safe).intval($PRINT_MODE)); |
| | | |
| | | // allow caching, unless remote images are present |
| | | if ((bool)$MESSAGE->is_safe) |
| | |
| | | $OUTPUT->set_env('uid', $MESSAGE->uid); |
| | | $OUTPUT->set_env('safemode', $MESSAGE->is_safe); |
| | | $OUTPUT->set_env('sender', $MESSAGE->sender['string']); |
| | | $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name))); |
| | | |
| | | // check for unset disposition notification |
| | | if ($MESSAGE->headers->mdn_to && !$MESSAGE->headers->mdn_sent && |
| | | $mbox_name != $CONFIG['drafts_mbox'] && $mbox_name != $CONFIG['sent_mbox']) |
| | | if ($MESSAGE->headers->mdn_to && |
| | | !$MESSAGE->headers->mdn_sent && |
| | | $IMAP->check_permflag('MDNSENT') && |
| | | $mbox_name != $CONFIG['drafts_mbox'] && |
| | | $mbox_name != $CONFIG['sent_mbox']) |
| | | { |
| | | if (intval($CONFIG['mdn_requests']) === 1) |
| | | { |
| | | if (rcmail_send_mdn($MESSAGE->uid)) |
| | | $OUTPUT->show_message('receiptsent', 'confirmation'); |
| | | else |
| | | $OUTPUT->show_message('errorsendingreceipt', 'error'); |
| | | } |
| | | else if (empty($CONFIG['mdn_requests'])) |
| | | { |
| | |
| | | $ol .= html::tag('li', null, sprintf("%s (%s)", Q($attach_prop->filename), Q(show_bytes($attach_prop->size)))); |
| | | } |
| | | else { |
| | | if (rc_strlen($attach_prop->filename) > 50) { |
| | | $filename = abbreviate_string($attach_prop->filename, 50); |
| | | $title = $attach_prop->filename; |
| | | } |
| | | else { |
| | | $filename = $attach_prop->filename; |
| | | $title = ''; |
| | | } |
| | | |
| | | $ol .= html::tag('li', null, |
| | | html::a(array( |
| | | 'href' => $MESSAGE->get_part_url($attach_prop->mime_id), |
| | |
| | | JS_OBJECT_NAME, |
| | | $attach_prop->mime_id, |
| | | $attach_prop->mimetype), |
| | | 'title' => Q($title), |
| | | ), |
| | | Q($attach_prop->filename))); |
| | | Q($filename))); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | $OUTPUT->add_handlers(array( |
| | | 'messageattachments' => 'rcmail_message_attachments', |
| | | 'mailboxname' => 'rcmail_mailbox_name_display', |
| | | 'blockedobjects' => 'rcmail_remote_objects_msg')); |
| | | |
| | | |
| | | if ($RCMAIL->action=='print' && template_exists('printmessage')) |
| | | if ($RCMAIL->action=='print' && $OUTPUT->template_exists('printmessage')) |
| | | $OUTPUT->send('printmessage'); |
| | | else if ($RCMAIL->action=='preview' && template_exists('messagepreview')) |
| | | else if ($RCMAIL->action=='preview' && $OUTPUT->template_exists('messagepreview')) |
| | | $OUTPUT->send('messagepreview'); |
| | | else |
| | | $OUTPUT->send('message'); |