From: Timo Sirainen Date: Sat, 12 Feb 2011 03:12:36 +0000 (+0200) Subject: lib-storage: mailbox_create() failed if it was done to \noselect mailbox. X-Git-Tag: 2.1.alpha1~347 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68d98139f81e77f90f91e7deef35dfe09c450677;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: mailbox_create() failed if it was done to \noselect mailbox. --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 5d8e59b12b..ba1513b55d 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -786,7 +786,10 @@ int mailbox_create(struct mailbox *box, const struct mailbox_update *update, 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);