changeset 18807:4f66f717fe87

imapc: If auth fails due to connection failure, don't treat it the same as failed login.
author Timo Sirainen <tss@iki.fi>
date Tue, 02 Jun 2015 22:47:21 +0300
parents 75d7bf7560d3
children 1972b0acce17
files src/lib-storage/index/imapc/imapc-storage.c
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/imapc/imapc-storage.c	Tue Jun 02 22:20:03 2015 +0300
+++ b/src/lib-storage/index/imapc/imapc-storage.c	Tue Jun 02 22:47:21 2015 +0300
@@ -212,12 +212,20 @@
 	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);
+		}
 	}
 }