]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: If auth fails due to connection failure, don't treat it the same as failed...
authorTimo Sirainen <tss@iki.fi>
Tue, 2 Jun 2015 19:47:21 +0000 (22:47 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 2 Jun 2015 19:47:21 +0000 (22:47 +0300)
src/lib-storage/index/imapc/imapc-storage.c

index 852a90f9ac55dd5acdb4285ab4476ab7ade89a3f..a9d5103064ef74048a1e50a96e271731afb4a537 100644 (file)
@@ -212,12 +212,20 @@ imapc_storage_client_login(const struct imapc_command_reply *reply,
        client->auth_failed = TRUE;
 
        if (client->_storage != NULL) {
-               mail_storage_set_error(&client->_storage->storage,
-                                      MAIL_ERROR_PERM, reply->text_full);
+               if (reply->state == IMAPC_COMMAND_STATE_DISCONNECTED)
+                       mail_storage_set_internal_error(&client->_storage->storage);
+               else {
+                       mail_storage_set_error(&client->_storage->storage,
+                                              MAIL_ERROR_PERM, reply->text_full);
+               }
        }
        if (client->_list != NULL) {
-               mailbox_list_set_error(&client->_list->list,
-                                      MAIL_ERROR_PERM, reply->text_full);
+               if (reply->state == IMAPC_COMMAND_STATE_DISCONNECTED)
+                       mailbox_list_set_internal_error(&client->_list->list);
+               else {
+                       mailbox_list_set_error(&client->_list->list,
+                                              MAIL_ERROR_PERM, reply->text_full);
+               }
        }
 }