dovecot-2.2: imap: If we disconnect client because mailbox is in...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 30 11:37:36 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/852bc94983ab
changeset: 17539:852bc94983ab
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 30 14:29:26 2014 +0300
description:
imap: If we disconnect client because mailbox is inconsistent, send the error message before BYE.

diffstat:

 src/imap/imap-commands-util.c |  16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diffs (45 lines):

diff -r d09ecf549f6a -r 852bc94983ab src/imap/imap-commands-util.c
--- a/src/imap/imap-commands-util.c	Mon Jun 30 14:28:31 2014 +0300
+++ b/src/imap/imap-commands-util.c	Mon Jun 30 14:29:26 2014 +0300
@@ -182,17 +182,16 @@
 	const char *error_string;
 	enum mail_error error;
 
+	error_string = mail_storage_get_last_error(storage, &error);
+	client_send_tagline(cmd, imap_get_error_string(cmd, error_string,
+						       error));
+
 	if (cmd->client->mailbox != NULL &&
 	    mailbox_is_inconsistent(cmd->client->mailbox)) {
 		/* we can't do forced CLOSE, so have to disconnect */
 		client_disconnect_with_error(cmd->client,
 			"IMAP session state is inconsistent, please relogin.");
-		return;
 	}
-
-	error_string = mail_storage_get_last_error(storage, &error);
-	client_send_tagline(cmd, imap_get_error_string(cmd, error_string,
-						       error));
 }
 
 void client_send_untagged_storage_error(struct client *client,
@@ -201,16 +200,15 @@
 	const char *error_string;
 	enum mail_error error;
 
+	error_string = mail_storage_get_last_error(storage, &error);
+	client_send_line(client, t_strconcat("* NO ", error_string, NULL));
+
 	if (client->mailbox != NULL &&
 	    mailbox_is_inconsistent(client->mailbox)) {
 		/* we can't do forced CLOSE, so have to disconnect */
 		client_disconnect_with_error(client,
 			"IMAP session state is inconsistent, please relogin.");
-		return;
 	}
-
-	error_string = mail_storage_get_last_error(storage, &error);
-	client_send_line(client, t_strconcat("* NO ", error_string, NULL));
 }
 
 bool client_parse_mail_flags(struct client_command_context *cmd,


More information about the dovecot-cvs mailing list