]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm backup: If local mailbox has more mails than remote, detect and delete it...
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 28 Jan 2016 17:55:06 +0000 (19:55 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 28 Jan 2016 17:55:06 +0000 (19:55 +0200)
src/doveadm/dsync/dsync-mailbox-import.c

index aebf02e9eb83e864846f5cb0f50c23fef90d2365..657b9c5c5194a0547a4d5bac7a66229ee5d4c996 100644 (file)
@@ -751,6 +751,11 @@ static bool dsync_mailbox_try_save_cur(struct dsync_mailbox_importer *importer,
                /* add a record for local mail */
                i_assert(importer->cur_mail != NULL);
                if (importer->revert_local_changes) {
+                       if (save_change == NULL) {
+                               dsync_mailbox_revert_existing_uid(importer, importer->cur_mail->uid,
+                                       t_strdup_printf("highest than remote's UIDs (remote UIDNEXT=%u)", importer->remote_uid_next));
+                               return TRUE;
+                       }
                        mail_expunge(importer->cur_mail);
                        importer->cur_mail_skip = TRUE;
                        importer->next_local_seq++;