]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm sync: When -1 parameter is used, ignore missing mailboxes in source.
authorTimo Sirainen <tss@iki.fi>
Sat, 21 Sep 2013 00:49:22 +0000 (03:49 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 21 Sep 2013 00:49:22 +0000 (03:49 +0300)
Previously the syncs finished with "Mailbox changes caused a desync." and
exit code 2. This was especially common when the destination server had
new autocreated mailboxes and user logged in after the first dsync.

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

index 984ef03e660b3e9980fe10201a7b5ebc5f522bf9..087ddf35e08d8688ccb50482d874ba7debfddd9f 100644 (file)
@@ -623,6 +623,16 @@ bool dsync_brain_slave_recv_mailbox(struct dsync_brain *brain)
        }
        if (box == NULL) {
                /* mailbox was probably deleted/renamed during sync */
+               if (brain->backup_send && brain->no_backup_overwrite) {
+                       if (brain->debug) {
+                               i_debug("brain %c: Ignore nonexistent "
+                                       "mailbox GUID %s with -1 sync",
+                                       brain->master_brain ? 'M' : 'S',
+                                       guid_128_to_string(dsync_box->mailbox_guid));
+                       }
+                       dsync_brain_slave_send_mailbox_lost(brain, dsync_box);
+                       return TRUE;
+               }
                //FIXME: verify this from log, and if not log an error.
                if (brain->debug) {
                        i_debug("brain %c: Change during sync: "