]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Fixed empty-header-workaround
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 8 Aug 2016 13:15:26 +0000 (16:15 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 8 Aug 2016 13:15:26 +0000 (16:15 +0300)
src/doveadm/dsync/dsync-mailbox-import.c

index c8192a8541ebb3c6b3f00d8fe2bd934f86de58af..a458abe870812bdf535a6593c4dbf1733c2560c0 100644 (file)
@@ -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 {