diff src/plugins/pop3-migration/pop3-migration-plugin.c @ 22451:e2b9cadf91e4

pop3-migration: Strip away invalid header lines. If there's no ":" in the header, remove it. Fixes matching mails with Zimbra.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 04 Sep 2017 12:40:49 +0300
parents 1ff8f91dafba
children 566bd6b3b348
line wrap: on
line diff
--- a/src/plugins/pop3-migration/pop3-migration-plugin.c	Fri Aug 25 13:38:35 2017 +0300
+++ b/src/plugins/pop3-migration/pop3-migration-plugin.c	Mon Sep 04 12:40:49 2017 +0300
@@ -186,6 +186,10 @@
 			 here while others don't. To make sure they can be
 			 matched correctly we want to stop here entirely. */
 			ctx->stop = TRUE;
+		} else if (!hdr->continued && hdr->middle_len == 0) {
+			/* not a valid "key: value" header -
+			   Zimbra's BODY[HEADER] strips this line away. */
+			*matched = TRUE;
 		} else if (hdr->continued && header_value_want_skip(hdr)) {
 			*matched = TRUE;
 		}