From 316e4dae0b5688670a9631cb03ce9a2533e9a0de Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 22 Dec 2014 17:09:38 +0000 Subject: [PATCH] Do not learn with legacy data. --- src/plugins/fuzzy_check.c | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index bc49a9b16..0c8378399 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -982,10 +982,12 @@ fuzzy_generate_commands (struct rspamd_task *task, struct fuzzy_rule *rule, /* * Try legacy first */ - cmd = fuzzy_cmd_from_text_part (rule, c, flag, value, task->task_pool, - part, TRUE, NULL); - if (cmd) { - g_ptr_array_add (res, cmd); + if (c == FUZZY_CHECK) { + cmd = fuzzy_cmd_from_text_part (rule, c, flag, value, task->task_pool, + part, TRUE, NULL); + if (cmd) { + g_ptr_array_add (res, cmd); + } } cmd = fuzzy_cmd_from_text_part (rule, c, flag, value, task->task_pool, part, FALSE, NULL); @@ -1004,12 +1006,14 @@ fuzzy_generate_commands (struct rspamd_task *task, struct fuzzy_rule *rule, fuzzy_module_ctx->min_height) { if (fuzzy_module_ctx->min_width <= 0 || image->width >= fuzzy_module_ctx->min_width) { - cmd = fuzzy_cmd_from_data_part (rule, c, flag, value, - task->task_pool, - image->data->data, image->data->len, - TRUE, NULL); - if (cmd) { - g_ptr_array_add (res, cmd); + if (c == FUZZY_CHECK) { + cmd = fuzzy_cmd_from_data_part (rule, c, flag, value, + task->task_pool, + image->data->data, image->data->len, + TRUE, NULL); + if (cmd) { + g_ptr_array_add (res, cmd); + } } cmd = fuzzy_cmd_from_data_part (rule, c, flag, value, task->task_pool, @@ -1031,12 +1035,14 @@ fuzzy_generate_commands (struct rspamd_task *task, struct fuzzy_rule *rule, fuzzy_check_content_type (rule, mime_part->type)) { if (fuzzy_module_ctx->min_bytes <= 0 || mime_part->content->len >= fuzzy_module_ctx->min_bytes) { - cmd = fuzzy_cmd_from_data_part (rule, c, flag, value, - task->task_pool, - mime_part->content->data, mime_part->content->len, - TRUE, NULL); - if (cmd) { - g_ptr_array_add (res, cmd); + if (c == FUZZY_CHECK) { + cmd = fuzzy_cmd_from_data_part (rule, c, flag, value, + task->task_pool, + mime_part->content->data, mime_part->content->len, + TRUE, NULL); + if (cmd) { + g_ptr_array_add (res, cmd); + } } cmd = fuzzy_cmd_from_data_part (rule, c, flag, value, task->task_pool, -- 2.39.5