aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-11-26 14:52:59 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-11-26 14:52:59 +0000
commita85e61f5a5437235a3b263b4f7a87425a1244b86 (patch)
treec5b3e8fb53200712b5428bdbc861372b6f1cf4f3 /src/plugins
parent85dbcc4822182bc3b2fb348b6da8493be60dbffb (diff)
downloadrspamd-a85e61f5a5437235a3b263b4f7a87425a1244b86.tar.gz
rspamd-a85e61f5a5437235a3b263b4f7a87425a1244b86.zip
Fix surbl module.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/surbl.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c
index dc62a9815..397a26ba4 100644
--- a/src/plugins/surbl.c
+++ b/src/plugins/surbl.c
@@ -402,6 +402,7 @@ surbl_module_config (struct config_file *cfg)
}
cur = ucl_obj_get_key (cur_rule, "bits");
if (cur != NULL && cur->type == UCL_OBJECT) {
+ it = NULL;
while ((cur_bit = ucl_iterate_object (cur, &it, true)) != NULL) {
if (ucl_object_key (cur_bit) != NULL && cur_bit->type == UCL_INT) {
bit = ucl_obj_toint (cur_bit);
@@ -414,11 +415,13 @@ surbl_module_config (struct config_file *cfg)
}
}
surbl_module_ctx->suffixes = g_list_prepend (surbl_module_ctx->suffixes, new_suffix);
+ register_callback_symbol (&cfg->cache, new_suffix->symbol, 1, surbl_test_url, new_suffix);
}
}
/* Add default suffix */
if (surbl_module_ctx->suffixes == NULL) {
msg_err ("surbl module loaded but no suffixes defined, skip checks");
+ return TRUE;
}
if (surbl_module_ctx->suffixes != NULL) {
@@ -653,7 +656,6 @@ process_dns_results (struct worker_task *task, struct suffix_item *suffix, gchar
{
GList *cur;
struct surbl_bit_item *bit;
- gint found = 0;
if (suffix->bits != NULL) {
cur = g_list_first (suffix->bits);
@@ -663,14 +665,9 @@ process_dns_results (struct worker_task *task, struct suffix_item *suffix, gchar
debug_task ("got result(%d) AND bit(%d): %d", (gint)addr, (gint)ntohl (bit->bit), (gint)bit->bit & (gint)ntohl (addr));
if (((gint)bit->bit & (gint)ntohl (addr)) != 0) {
insert_result (task, bit->symbol, 1, g_list_prepend (NULL, memory_pool_strdup (task->task_pool, url)));
- found = 1;
}
cur = g_list_next (cur);
}
-
- if (!found) {
- insert_result (task, suffix->symbol, 1, g_list_prepend (NULL, memory_pool_strdup (task->task_pool, url)));
- }
}
else {
insert_result (task, suffix->symbol, 1, g_list_prepend (NULL, memory_pool_strdup (task->task_pool, url)));