From: Timo Sirainen Date: Fri, 22 Feb 2013 08:17:14 +0000 (+0200) Subject: fts: Don't send binary MIME parts to backend through UTF8 text conversion. X-Git-Tag: 2.2.rc1~1^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6231264bedab49be190f2e89fd9cb6ca59ae62d;p=thirdparty%2Fdovecot%2Fcore.git fts: Don't send binary MIME parts to backend through UTF8 text conversion. Based on patch by Mike Abbott / Apple. --- diff --git a/src/plugins/fts/fts-build-mail.c b/src/plugins/fts/fts-build-mail.c index c6cec4314f..31f50c8d4d 100644 --- a/src/plugins/fts/fts-build-mail.c +++ b/src/plugins/fts/fts-build-mail.c @@ -170,6 +170,7 @@ fts_build_body_begin(struct fts_mail_build_context *ctx, bool *binary_body_r) strncmp(content_type, "message/", 8) == 0) { /* text body parts */ key.type = FTS_BACKEND_BUILD_KEY_BODY_PART; + ctx->body_parser = fts_parser_text_init(); } else { /* possibly binary */ if ((ctx->update_ctx->backend->flags & @@ -178,8 +179,6 @@ fts_build_body_begin(struct fts_mail_build_context *ctx, bool *binary_body_r) *binary_body_r = TRUE; key.type = FTS_BACKEND_BUILD_KEY_BODY_PART_BINARY; } - if (ctx->body_parser == NULL) - ctx->body_parser = fts_parser_text_init(); key.body_content_type = content_type; key.body_content_disposition = ctx->content_disposition; return fts_backend_update_set_build_key(ctx->update_ctx, &key);