changeset 12658:078419bc739a

lib-storage: mailbox_create() failed if it was done to \noselect mailbox.
author Timo Sirainen <tss@iki.fi>
date Sat, 12 Feb 2011 05:12:36 +0200
parents 03a8767cb9e5
children c65dc5f520f8
files src/lib-storage/mail-storage.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/mail-storage.c	Sat Feb 12 04:59:44 2011 +0200
+++ b/src/lib-storage/mail-storage.c	Sat Feb 12 05:12:36 2011 +0200
@@ -786,7 +786,10 @@
 		MAILBOX_DIR_CREATE_TYPE_MAILBOX;
 	if (box->list->v.create_mailbox_dir(box->list, box->name, type) < 0) {
 		mail_storage_copy_list_error(box->storage, box->list);
-		return -1;
+		if (directory ||
+		    mailbox_get_last_mail_error(box) != MAIL_ERROR_EXISTS)
+			return -1;
+		/* the directory already exists, but the mailbox might not */
 	}
 	mailbox_refresh_permissions(box);