]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Do not try replace remote folder GUID when doing oneway sync
authorAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 24 Nov 2016 17:32:44 +0000 (19:32 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 24 Nov 2016 18:21:05 +0000 (20:21 +0200)
Oneway sync tried to replace remote folder's GUID when
running in one way mode. This causes trouble, e.g.
when running with imapc, because you can't do this.

src/doveadm/dsync/dsync-brain-mailbox-tree-sync.c

index 60d429849b2702e51a78a8d7e1b8585a47a2b272..5d67c694703fcf3b989325b13f9b90e3e36d5500 100644 (file)
@@ -57,7 +57,14 @@ sync_create_box(struct dsync_brain *brain, struct mailbox *box,
        }
 
        ret = memcmp(mailbox_guid, metadata.guid, sizeof(metadata.guid));
-       if (ret > 0) {
+
+       /* if THEIR guid is bigger than OUR guid, and we are not doing
+          backup in either direction, OR GUID did not match and we are
+          receiving backup, try change the mailbox GUID.
+       */
+
+       if ((ret > 0 && !brain->backup_recv &&
+            !brain->backup_send) || (ret != 0 && brain->backup_recv)) {
                if (brain->debug) {
                        i_debug("brain %c: Changing mailbox %s GUID %s -> %s",
                                brain->master_brain ? 'M' : 'S',