summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-10-14 10:37:32 +0000
committeralecpl <alec@alec.pl>2010-10-14 10:37:32 +0000
commit2d1d68bc7e1683bca869fcd1eca517ef209097d8 (patch)
treee34ad5dcf2584cc2794ddb0b0b8343e491aea304
parent0f0c17ad9ef6dc5f82e7147a16f2cab7aae657db (diff)
- Display IMAP errors for LIST/THREAD/SEARCH commands, fixes #1486905
-rw-r--r--CHANGELOG1
-rw-r--r--program/include/rcube_imap_generic.php2
-rw-r--r--program/localization/en_US/messages.inc1
-rw-r--r--program/localization/pl_PL/messages.inc1
-rw-r--r--program/steps/mail/list.inc15
-rw-r--r--program/steps/mail/search.inc5
6 files changed, 20 insertions, 5 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0a17e1a74..19290c7ff 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -29,6 +29,7 @@ CHANGELOG Roundcube Webmail
- Add SASL proxy authentication for SMTP (#1486693)
- Improve displaying of UI messages (#1486977)
- Fix double e-mail filed in identity form (#1487054)
+- Display IMAP errors for LIST/THREAD/SEARCH commands (#1486905)
RELEASE 0.4.2
-------------
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 0ad582ffc..ee5638e46 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -278,7 +278,7 @@ class rcube_imap_generic
$str = trim($matches[2]);
if ($res == 'OK') {
- return self::ERROR_OK;
+ return $this->errornum = self::ERROR_OK;
} else if ($res == 'NO') {
$this->errornum = self::ERROR_NO;
} else if ($res == 'BAD') {
diff --git a/program/localization/en_US/messages.inc b/program/localization/en_US/messages.inc
index 26fa36ad7..6474c9dbc 100644
--- a/program/localization/en_US/messages.inc
+++ b/program/localization/en_US/messages.inc
@@ -23,6 +23,7 @@ $messages['cookiesdisabled'] = 'Your browser does not accept cookies';
$messages['sessionerror'] = 'Your session is invalid or expired';
$messages['imaperror'] = 'Connection to IMAP server failed';
$messages['servererror'] = 'Server Error!';
+$messages['servererrormsg'] = 'Server Error: $msg';
$messages['invalidrequest'] = 'Invalid request! No data was saved.';
$messages['nomessagesfound'] = 'No messages found in this mailbox';
$messages['loggedout'] = 'You have successfully terminated the session. Good bye!';
diff --git a/program/localization/pl_PL/messages.inc b/program/localization/pl_PL/messages.inc
index 91b3c901c..83c566472 100644
--- a/program/localization/pl_PL/messages.inc
+++ b/program/localization/pl_PL/messages.inc
@@ -28,6 +28,7 @@ $messages['cookiesdisabled'] = 'Twoja przeglądarka nie obsługuje ciasteczek!';
$messages['sessionerror'] = 'Błąd sesji bądź sesja wygasła!';
$messages['imaperror'] = 'Błąd połączenia z serwerem!';
$messages['servererror'] = 'Błąd serwera!';
+$messages['servererrormsg'] = 'Błąd serwera: $msg';
$messages['invalidrequest'] = 'Błędne żądanie! Nie zapisano danych.';
$messages['nomessagesfound'] = 'Brak wiadomości w skrzynce.';
$messages['loggedout'] = 'Użytkownik wylogował się poprawnie.';
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');
}