dovecot-2.2: dsync: Never try to create INBOX via temporary name...

dovecot at dovecot.org dovecot at dovecot.org
Fri Dec 14 12:32:54 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/9a707794ee54
changeset: 15466:9a707794ee54
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Dec 14 12:03:55 2012 +0200
description:
dsync: Never try to create INBOX via temporary name and rename.

diffstat:

 src/doveadm/dsync/dsync-mailbox-tree-sync.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r c6275c34d158 -r 9a707794ee54 src/doveadm/dsync/dsync-mailbox-tree-sync.c
--- a/src/doveadm/dsync/dsync-mailbox-tree-sync.c	Fri Dec 14 11:45:54 2012 +0200
+++ b/src/doveadm/dsync/dsync-mailbox-tree-sync.c	Fri Dec 14 12:03:55 2012 +0200
@@ -634,8 +634,12 @@
 	local_node2 = hash_table_lookup(ctx->local_tree->guid_hash, guid_p);
 
 	/* FIXME: kludge to avoid problems where one of the mailboxes
-	 doesn't exist yet */
+	   doesn't exist yet. they seem to somewhat unnecessarily try to create
+	   temporary mailboxes and later rename them. this definitely doesn't
+	   work with INBOX. */
 	if (local_node2 == NULL &&
+	    (strcmp(local_node1->name, "INBOX") != 0 ||
+	     local_node1->parent->parent != NULL) &&
 	    remote_node2->existence == DSYNC_MAILBOX_NODE_EXISTS &&
 	    !dsync_mailbox_node_is_dir(remote_node2) &&
 	    ctx->sync_type != DSYNC_MAILBOX_TREES_SYNC_TYPE_PRESERVE_LOCAL) {
@@ -643,6 +647,8 @@
 		return TRUE;
 	}
 	if (remote_node1 == NULL &&
+	    (strcmp(remote_node2->name, "INBOX") != 0 ||
+	     remote_node2->parent->parent != NULL) &&
 	    local_node1->existence == DSYNC_MAILBOX_NODE_EXISTS &&
 	    !dsync_mailbox_node_is_dir(local_node1) &&
 	    ctx->sync_type != DSYNC_MAILBOX_TREES_SYNC_TYPE_PRESERVE_REMOTE) {


More information about the dovecot-cvs mailing list