]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lda: If two LDAs try to autocreate the same mailbox at the same time, don't fail...
authorTimo Sirainen <tss@iki.fi>
Mon, 31 May 2010 15:46:08 +0000 (16:46 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 31 May 2010 15:46:08 +0000 (16:46 +0100)
--HG--
branch : HEAD

src/lib-lda/mail-deliver.c

index 3f9f127b87d4094a84fb7da700254e6813b12147..4d11c897b4d16735cbcbdb6349d9f582db99297c 100644 (file)
@@ -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 */