diff --git a/program/include/rcmail.php b/program/include/rcmail.php index f823fab51..43fb4a85b 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -1930,6 +1930,22 @@ class rcmail extends rcube } } + /** + * Displays an error message on storage fatal errors + */ + public function storage_fatal_error() + { + $err_code = $this->storage->get_error_code(); + switch ($err_code) { + // Not all are really fatal, but these should catch + // connection/authentication errors the best we can + case rcube_imap_generic::ERROR_NO: + case rcube_imap_generic::ERROR_BAD: + case rcube_imap_generic::ERROR_BYE: + $this->display_server_error(); + } + } + /** * Output HTML editor scripts * diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc index ac0f360eb..dd6e488a4 100644 --- a/program/steps/mail/check_recent.inc +++ b/program/steps/mail/check_recent.inc @@ -54,6 +54,8 @@ else { $plugin = $RCMAIL->plugins->exec_hook('check_recent', array('folders' => $a_mailboxes, 'all' => $check_all)); $a_mailboxes = $plugin['folders']; +$RCMAIL->storage_fatal_error(); + // check recent/unseen counts foreach ($a_mailboxes as $mbox_name) { $is_current = $mbox_name == $current || ($search_request && is_object($_SESSION['search'][1]) && in_array($mbox_name, (array)$_SESSION['search'][1]->get_parameters('MAILBOX'))); @@ -65,6 +67,10 @@ foreach ($a_mailboxes as $mbox_name) { // Get mailbox status $status = $RCMAIL->storage->folder_status($mbox_name, $diff); + if ($is_current) { + $RCMAIL->storage_fatal_error(); + } + if ($status & 1) { // trigger plugin hook $RCMAIL->plugins->exec_hook('new_messages',