diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-12-22 17:09:38 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-12-22 17:09:38 +0000 |
commit | 316e4dae0b5688670a9631cb03ce9a2533e9a0de (patch) | |
tree | f69049447a2ab2263d89219e889d944b9d1e4ff7 | |
parent | 349e75060a0f79399d374930d3e0bb4d82b72dd9 (diff) | |
download | rspamd-316e4dae0b5688670a9631cb03ce9a2533e9a0de.tar.gz rspamd-316e4dae0b5688670a9631cb03ce9a2533e9a0de.zip |
Do not learn with legacy data.
-rw-r--r-- | src/plugins/fuzzy_check.c | 38 |
1 files 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, |