]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Fixed last-common-uid lookup when local UID was expunged but remote wasn't.
authorTimo Sirainen <tss@iki.fi>
Sat, 16 Feb 2013 12:51:50 +0000 (14:51 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 16 Feb 2013 12:51:50 +0000 (14:51 +0200)
src/doveadm/dsync/dsync-mailbox-import.c

index 9c861dd2a64b5923ef6a1bbf81302979926b3bff..125f8cc1eaff9cca2764399905bf7be4aa0cb607 100644 (file)
@@ -1069,13 +1069,15 @@ dsync_mailbox_find_common_expunged_uid(struct dsync_mailbox_importer *importer,
                return FALSE;
 
        i_assert(local_change->type == DSYNC_MAIL_CHANGE_TYPE_EXPUNGE);
-       if (!dsync_mail_change_guid_equals(local_change, change->guid)) {
+       if (dsync_mail_change_guid_equals(local_change, change->guid))
+               importer->last_common_uid = change->uid;
+       else if (change->type != DSYNC_MAIL_CHANGE_TYPE_EXPUNGE)
+               dsync_mailbox_common_uid_found(importer);
+       else {
                /* GUID mismatch for two expunged mails. dsync can't update
                   GUIDs for already expunged messages, so we can't immediately
                   determine that the rest of the messages are a mismatch. so
                   for now we'll just skip over this pair. */
-       } else {
-               importer->last_common_uid = change->uid;
        }
        return TRUE;
 }