From: Timo Sirainen Date: Mon, 31 May 2010 15:46:08 +0000 (+0100) Subject: lib-lda: If two LDAs try to autocreate the same mailbox at the same time, don't fail... X-Git-Tag: 2.0.beta6~97 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=014863702b55990240e2b64754b439b3e2f907dc;p=thirdparty%2Fdovecot%2Fcore.git lib-lda: If two LDAs try to autocreate the same mailbox at the same time, don't fail the other one. --HG-- branch : HEAD --- diff --git a/src/lib-lda/mail-deliver.c b/src/lib-lda/mail-deliver.c index 3f9f127b87..4d11c897b4 100644 --- a/src/lib-lda/mail-deliver.c +++ b/src/lib-lda/mail-deliver.c @@ -129,8 +129,11 @@ mailbox_open_or_create_synced(struct mail_deliver_context *ctx, /* try creating it. */ if (mailbox_create(box, NULL, FALSE) < 0) { *error_r = mail_storage_get_last_error(storage, &error); - mailbox_free(&box); - return NULL; + if (error != MAIL_ERROR_EXISTS) { + mailbox_free(&box); + return NULL; + } + /* someone else just created it */ } if (ctx->set->lda_mailbox_autosubscribe) { /* (try to) subscribe to it */