dovecot-2.2: lib-storage: mailbox_list_mailbox() now copies the ...

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 18 23:25:26 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/fca7232724dd
changeset: 18369:fca7232724dd
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Mar 19 00:32:44 2015 +0200
description:
lib-storage: mailbox_list_mailbox() now copies the mailbox_exists() error.
Instead of assuming it has to be an internal error.

diffstat:

 src/lib-storage/mailbox-list.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (26 lines):

diff -r 3ed51d56e2a3 -r fca7232724dd src/lib-storage/mailbox-list.c
--- a/src/lib-storage/mailbox-list.c	Wed Mar 18 17:10:23 2015 +0200
+++ b/src/lib-storage/mailbox-list.c	Thu Mar 19 00:32:44 2015 +0200
@@ -1417,12 +1417,18 @@
 		   list=Maildir++ (for indexes), but list->ns->list=imapc */
 		box = mailbox_alloc(list->ns->list, "INBOX", 0);
 		ret = mailbox_exists(box, FALSE, &existence);
+		if (ret < 0) {
+			const char *errstr;
+			enum mail_error error;
+
+			/* internal error or with imapc we can get here with
+			   login failures */
+			errstr = mailbox_get_last_error(box, &error);
+			mailbox_list_set_error(list, error, errstr);
+		}
 		mailbox_free(&box);
-		if (ret < 0) {
-			/* this can only be an internal error */
-			mailbox_list_set_internal_error(list);
+		if (ret < 0)
 			return -1;
-		}
 		switch (existence) {
 		case MAILBOX_EXISTENCE_NONE:
 		case MAILBOX_EXISTENCE_NOSELECT:


More information about the dovecot-cvs mailing list