dovecot-2.2: imapc: Don't wait for login to succeed at mailbox l...

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


details:   http://hg.dovecot.org/dovecot-2.2/rev/9c7c345f2b2a
changeset: 18374:9c7c345f2b2a
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Mar 19 01:24:32 2015 +0200
description:
imapc: Don't wait for login to succeed at mailbox list creation.
The failure will be visible in the next command. This wait was here mainly
for imap, but cbdfca7d24a6 implements the wait in imap process directly.
Other (current) protocols don't need such wait at all.

Most importantly this change allows doveadm to handle imapc login failures
by seeing them as MAIL_ERROR_PERM errors when listing mailboxes or opening a
mailbox. This allows it to return a different exit code from temporary
failure (which it is not).

diffstat:

 src/lib-storage/index/imapc/imapc-list.c |  12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)

diffs (29 lines):

diff -r 995df5989e56 -r 9c7c345f2b2a src/lib-storage/index/imapc/imapc-list.c
--- a/src/lib-storage/index/imapc/imapc-list.c	Thu Mar 19 01:21:20 2015 +0200
+++ b/src/lib-storage/index/imapc/imapc-list.c	Thu Mar 19 01:24:32 2015 +0200
@@ -66,7 +66,6 @@
 static int imapc_list_init(struct mailbox_list *_list, const char **error_r)
 {
 	struct imapc_mailbox_list *list = (struct imapc_mailbox_list *)_list;
-	char sep;
 
 	list->set = mail_user_set_get_driver_settings(_list->ns->user->set_info,
 						      _list->ns->user->set,
@@ -81,17 +80,6 @@
 	imapc_storage_client_register_untagged(list->client, "LSUB",
 					       imapc_untagged_lsub);
 	imapc_list_send_hierarcy_sep_lookup(list);
-	if ((_list->ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0) {
-		/* we're using imapc for the INBOX namespace. wait and make
-		   sure we can successfully access the IMAP server (so if the
-		   username is invalid we don't just keep failing every
-		   command). */
-		if (imapc_list_try_get_root_sep(list, &sep) < 0) {
-			imapc_storage_client_unref(&list->client);
-			*error_r = "Failed to access imapc backend";
-			return -1;
-		}
-	}
 	return 0;
 }
 


More information about the dovecot-cvs mailing list