]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Skip text parts when checking binary parts in fuzzy check
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 27 May 2017 22:43:45 +0000 (23:43 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 27 May 2017 22:43:45 +0000 (23:43 +0100)
src/plugins/fuzzy_check.c

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