[Dovecot] patch to fix binary attachment indexing

Mike Abbott michael.abbott at apple.com
Fri Feb 22 04:06:26 EET 2013


FTS indexing of binary attachments is broken in dovecot-2.1.15:  the binary data which fts_build_mail_real() sends to fts_build_body_block() (which sends it to fts_backend_update_build_more()) is garbled.  This patch ungarbles it but I’m not positive it’s the best fix.

--- dovecot-2.1.15/src/plugins/fts/fts-build-mail.c	2012-11-27 02:07:27.000000000 -0600
+++ dovecot/src/plugins/fts/fts-build-mail.c	2013-02-21 19:48:15.000000000 -0600
@@ -178,7 +178,8 @@
 		*binary_body_r = TRUE;
 		key.type = FTS_BACKEND_BUILD_KEY_BODY_PART_BINARY;
 	}
-	if (ctx->body_parser == NULL)
+	if (ctx->body_parser == NULL &&
+	    key.type != FTS_BACKEND_BUILD_KEY_BODY_PART_BINARY)
 		ctx->body_parser = fts_parser_text_init();
 	key.body_content_type = content_type;
 	key.body_content_disposition = ctx->content_disposition;




More information about the dovecot mailing list