diff options
author | alecpl <alec@alec.pl> | 2010-10-14 10:37:32 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-10-14 10:37:32 +0000 |
commit | 2d1d68bc7e1683bca869fcd1eca517ef209097d8 (patch) | |
tree | e34ad5dcf2584cc2794ddb0b0b8343e491aea304 /program/steps | |
parent | 0f0c17ad9ef6dc5f82e7147a16f2cab7aae657db (diff) |
- Display IMAP errors for LIST/THREAD/SEARCH commands, fixes #1486905
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/mail/list.inc | 15 | ||||
-rw-r--r-- | program/steps/mail/search.inc | 5 |
2 files changed, 16 insertions, 4 deletions
diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc index f5fc44bd4..6353be7cc 100644 --- a/program/steps/mail/list.inc +++ b/program/steps/mail/list.inc @@ -103,10 +103,17 @@ if (isset($a_headers) && count($a_headers)) if ($search_request) $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $count)); } -else if ($search_request) - $OUTPUT->show_message('searchnomatch', 'notice'); -else - $OUTPUT->show_message('nomessagesfound', 'notice'); +else { + // handle IMAP errors (e.g. #1486905) + if ($err_code = $IMAP->get_error_code()) { + $err_str = $IMAP->get_error_str(); + $OUTPUT->show_message('servererrormsg', 'error', array('msg' => $err_str)); + } + else if ($search_request) + $OUTPUT->show_message('searchnomatch', 'notice'); + else + $OUTPUT->show_message('nomessagesfound', 'notice'); +} // send response $OUTPUT->send(); diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc index db46ce428..90d1c374c 100644 --- a/program/steps/mail/search.inc +++ b/program/steps/mail/search.inc @@ -122,6 +122,11 @@ if (!empty($result_h)) { if ($search_str) $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $IMAP->messagecount(NULL, 'ALL'))); } +// handle IMAP errors (e.g. #1486905) +else if ($err_code = $IMAP->get_error_code()) { + $err_str = $IMAP->get_error_str(); + $OUTPUT->show_message('servererrormsg', 'error', array('msg' => $err_str)); +} else { $OUTPUT->show_message('searchnomatch', 'notice'); } |