diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-06-29 19:32:31 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-06-29 19:32:31 +0400 |
commit | 025f2000d515244e085cd82ac089d7f0271fc531 (patch) | |
tree | 1ce03cdd34717418194aaf5fdee6584ad241cc1c /src/plugins/emails.c | |
parent | 21a2da8ea3da88fe2e54785189c0a328fcab4a2a (diff) | |
download | rspamd-025f2000d515244e085cd82ac089d7f0271fc531.tar.gz rspamd-025f2000d515244e085cd82ac089d7f0271fc531.zip |
* Add views support (not completely tested yet)
Diffstat (limited to 'src/plugins/emails.c')
-rw-r--r-- | src/plugins/emails.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/plugins/emails.c b/src/plugins/emails.c index 2e2dcac63..67a641ab5 100644 --- a/src/plugins/emails.c +++ b/src/plugins/emails.c @@ -33,6 +33,7 @@ #include "../cfg_file.h" #include "../expressions.h" #include "../util.h" +#include "../view.h" #define DEFAULT_SYMBOL "R_BAD_EMAIL" @@ -204,16 +205,18 @@ emails_mime_filter (struct worker_task *task) emails = extract_emails (task); - if (email_module_ctx->blacklist && emails) { - cur = g_list_first (emails); + if (check_view (task->cfg->views, email_module_ctx->symbol, task)) { + if (email_module_ctx->blacklist && emails) { + cur = g_list_first (emails); - while (cur) { - if (g_hash_table_lookup (email_module_ctx->blacklist, cur->data) != NULL) { - insert_result (task, email_module_ctx->metric, email_module_ctx->symbol, 1, - g_list_prepend (NULL, memory_pool_strdup (task->task_pool, (char *)cur->data))); - + while (cur) { + if (g_hash_table_lookup (email_module_ctx->blacklist, cur->data) != NULL) { + insert_result (task, email_module_ctx->metric, email_module_ctx->symbol, 1, + g_list_prepend (NULL, memory_pool_strdup (task->task_pool, (char *)cur->data))); + + } + cur = g_list_next (cur); } - cur = g_list_next (cur); } } |