From c3aebe3bd173bb339947d4fb6fa4f0e090c38e69 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 16 Feb 2013 14:51:50 +0200 Subject: [PATCH] dsync: Fixed last-common-uid lookup when local UID was expunged but remote wasn't. --- src/doveadm/dsync/dsync-mailbox-import.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/doveadm/dsync/dsync-mailbox-import.c b/src/doveadm/dsync/dsync-mailbox-import.c index 9c861dd2a6..125f8cc1ea 100644 --- a/src/doveadm/dsync/dsync-mailbox-import.c +++ b/src/doveadm/dsync/dsync-mailbox-import.c @@ -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; } -- 2.47.3