]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Don't wait for login to succeed at mailbox list creation.
authorTimo Sirainen <tss@iki.fi>
Wed, 18 Mar 2015 23:24:32 +0000 (01:24 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 18 Mar 2015 23:24:32 +0000 (01:24 +0200)
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).

src/lib-storage/index/imapc/imapc-list.c

index ead768b5c448ce09b20b71a0d303e6d1b1195f7a..733b537b63e8e78df87c73e85ae6e6d6eb3cd10a 100644 (file)
@@ -66,7 +66,6 @@ static struct mailbox_list *imapc_list_alloc(void)
 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 @@ static int imapc_list_init(struct mailbox_list *_list, const char **error_r)
        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;
 }