dovecot-2.0: lib-lda: If two LDAs try to autocreate the same mai...

dovecot at dovecot.org dovecot at dovecot.org
Mon May 31 18:46:11 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/c4f56ed9dae0
changeset: 11433:c4f56ed9dae0
user:      Timo Sirainen <tss at iki.fi>
date:      Mon May 31 16:46:08 2010 +0100
description:
lib-lda: If two LDAs try to autocreate the same mailbox at the same time, don't fail the other one.

diffstat:

 src/lib-lda/mail-deliver.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (17 lines):

diff -r dcfabc2e2143 -r c4f56ed9dae0 src/lib-lda/mail-deliver.c
--- a/src/lib-lda/mail-deliver.c	Mon May 31 16:42:23 2010 +0100
+++ b/src/lib-lda/mail-deliver.c	Mon May 31 16:46:08 2010 +0100
@@ -129,8 +129,11 @@
 	/* 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 */


More information about the dovecot-cvs mailing list