dovecot-2.1: imap: If selected mailbox is DELETEd, disconnect cl...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Jun 28 06:32:06 EEST 2012
details: http://hg.dovecot.org/dovecot-2.1/rev/81a659ab9183
changeset: 14582:81a659ab9183
user: Timo Sirainen <tss at iki.fi>
date: Thu Jun 28 06:32:00 2012 +0300
description:
imap: If selected mailbox is DELETEd, disconnect client.
diffstat:
src/imap/cmd-delete.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diffs (30 lines):
diff -r 06ba409a63d3 -r 81a659ab9183 src/imap/cmd-delete.c
--- a/src/imap/cmd-delete.c Wed Jun 27 12:29:42 2012 +0300
+++ b/src/imap/cmd-delete.c Thu Jun 28 06:32:00 2012 +0300
@@ -10,6 +10,7 @@
struct mailbox *box;
const char *name, *errstr;
enum mail_error error;
+ bool disconnect = FALSE;
/* <mailbox> */
if (!client_read_string_args(cmd, 1, &name))
@@ -31,6 +32,7 @@
/* deleting selected mailbox. close it first */
client_search_updates_free(client);
mailbox_free(&client->mailbox);
+ disconnect = TRUE;
}
if (mailbox_delete(box) == 0)
@@ -45,5 +47,10 @@
}
}
mailbox_free(&box);
+
+ if (disconnect) {
+ client_disconnect_with_error(cmd->client,
+ "Selected mailbox was deleted, have to disconnect.");
+ }
return TRUE;
}
More information about the dovecot-cvs
mailing list