From 8900a7e4b7f7365c0e183660099e1ba7889fc3a5 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 27 May 2017 23:43:45 +0100 Subject: [PATCH] [Fix] Skip text parts when checking binary parts in fuzzy check --- src/plugins/fuzzy_check.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index dbf88e54f..ccca8eddc 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -2371,7 +2371,9 @@ fuzzy_generate_commands (struct rspamd_task *task, struct fuzzy_rule *rule, } if (G_LIKELY (!(flags & FUZZY_CHECK_FLAG_NOIMAGES))) { - if (mime_part->parsed_data.len > 0 && + if (mime_part->ct && + !(mime_part->flags & RSPAMD_MIME_PART_TEXT) && + mime_part->parsed_data.len > 0 && fuzzy_check_content_type (rule, mime_part->ct)) { if (fuzzy_module_ctx->min_bytes <= 0 || mime_part->parsed_data.len >= fuzzy_module_ctx->min_bytes) { -- 2.39.5