dovecot-2.2: dbox: Fail if trying to create a mailbox that alrea...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 16 18:57:45 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/004b69090776
changeset: 15800:004b69090776
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Feb 02 00:31:44 2013 +0200
description:
dbox: Fail if trying to create a mailbox that already exists.

diffstat:

 src/lib-storage/index/dbox-common/dbox-storage.c |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (16 lines):

diff -r bf80034a547d -r 004b69090776 src/lib-storage/index/dbox-common/dbox-storage.c
--- a/src/lib-storage/index/dbox-common/dbox-storage.c	Thu Jan 31 18:27:22 2013 +0200
+++ b/src/lib-storage/index/dbox-common/dbox-storage.c	Sat Feb 02 00:31:44 2013 +0200
@@ -254,6 +254,12 @@
 	if (mailbox_open(box) < 0)
 		return -1;
 
+	if (mail_index_get_header(box->view)->uid_validity != 0) {
+		mail_storage_set_error(box->storage, MAIL_ERROR_EXISTS,
+				       "Mailbox already exists");
+		return -1;
+	}
+
 	/* if alt path already exists and contains files, rebuild storage so
 	   that we don't start overwriting files. */
 	alt_path = mailbox_list_get_path(box->list, box->name,


More information about the dovecot-cvs mailing list