summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail/func.inc
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-06-08 12:46:05 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-06-08 12:46:05 +0000
commitd9daaac0849808d71f20faed21df4b51a3df0186 (patch)
treeeb62d478cc4d477d5da3c82fae4c0eeb4f01540d /roundcubemail/program/steps/mail/func.inc
parent1f6d9ef93e019d30c6afbfcb401620c2bab6f2c5 (diff)
- Fix some IMAP errors handling when opening the message (#1485443)
git-svn-id: https://svn.roundcube.net/trunk@3726 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/func.inc')
-rw-r--r--roundcubemail/program/steps/mail/func.inc20
1 files changed, 20 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc
index d1850d6cf..defb6f9cc 100644
--- a/roundcubemail/program/steps/mail/func.inc
+++ b/roundcubemail/program/steps/mail/func.inc
@@ -964,6 +964,11 @@ function rcmail_message_body($attrib)
if (!isset($part->body))
$part->body = $MESSAGE->get_part_content($part->mime_id);
+ // message is cached but not exists (#1485443), or other error
+ if ($part->body === false) {
+ rcmail_message_error($MESSAGE->uid);
+ }
+
// re-format format=flowed content
if ($part->ctype_secondary == "plain" && $part->ctype_parameters['format'] == "flowed")
$part->body = rcube_message::unfold_flowed($part->body);
@@ -1550,6 +1555,21 @@ function rcmail_search_filter($attrib)
return $out;
}
+function rcmail_message_error($uid=null)
+{
+ global $RCMAIL;
+
+ // Set env variables for messageerror.html template
+ if ($RCMAIL->action == 'show') {
+ $mbox_name = $RCMAIL->imap->get_mailbox_name();
+ $RCMAIL->output->set_env('mailbox', $mbox_name);
+ $RCMAIL->output->set_env('uid', null);
+ }
+ // display error message
+ $RCMAIL->output->show_message('messageopenerror', 'error');
+ // ... display message error page
+ $RCMAIL->output->send('messageerror');
+}
// register UI objects
$OUTPUT->add_handlers(array(