From 94a1fedb51b3403bb879db9f3c4430ae34865e8e Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 8 Aug 2016 16:15:26 +0300 Subject: [PATCH] dsync: Fixed empty-header-workaround --- src/doveadm/dsync/dsync-mailbox-import.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/doveadm/dsync/dsync-mailbox-import.c b/src/doveadm/dsync/dsync-mailbox-import.c index c8192a8541..a458abe870 100644 --- a/src/doveadm/dsync/dsync-mailbox-import.c +++ b/src/doveadm/dsync/dsync-mailbox-import.c @@ -1549,7 +1549,12 @@ dsync_mailbox_import_match_msg(struct dsync_mailbox_importer *importer, *result_r = "Error fetching header stream"; return -1; } - if (strcmp(change->hdr_hash, hdr_hash) == 0) { + if (importer->empty_hdr_workaround && + (dsync_mail_hdr_hash_is_empty(change->hdr_hash) || + dsync_mail_hdr_hash_is_empty(hdr_hash))) { + *result_r = "Empty headers found with workaround enabled - assuming a match"; + return 1; + } else if (strcmp(change->hdr_hash, hdr_hash) == 0) { *result_r = "Headers hashes match"; return 1; } else { -- 2.47.3