aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/surbl.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-12 17:22:33 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-08-12 17:22:33 +0100
commit9fb4a7f6e61d361b46eaae0c6b8dbe2805905e36 (patch)
treef68c936404bf6c5ab1e4e780dacb952f6882695c /src/plugins/surbl.c
parentaef19db4a81bcc40db2047c1c540f09f07fc9fd1 (diff)
downloadrspamd-9fb4a7f6e61d361b46eaae0c6b8dbe2805905e36.tar.gz
rspamd-9fb4a7f6e61d361b46eaae0c6b8dbe2805905e36.zip
Rework symbols weights.
Diffstat (limited to 'src/plugins/surbl.c')
-rw-r--r--src/plugins/surbl.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c
index 997115d6d..5a4b0a86d 100644
--- a/src/plugins/surbl.c
+++ b/src/plugins/surbl.c
@@ -315,21 +315,24 @@ register_bit_symbols (struct rspamd_config *cfg, struct suffix_item *suffix,
while (g_hash_table_iter_next (&it, &k, &v)) {
bit = v;
- rspamd_symbols_cache_add_symbol_virtual (cfg->cache, bit->symbol,
- 1, parent_id);
+ rspamd_symbols_cache_add_symbol (cfg->cache, bit->symbol,
+ 0, NULL, NULL,
+ SYMBOL_TYPE_VIRTUAL, parent_id);
msg_debug ("bit: %d", bit->bit);
}
}
else if (suffix->bits != NULL) {
for (i = 0; i < suffix->bits->len; i++) {
bit = &g_array_index (suffix->bits, struct surbl_bit_item, i);
- rspamd_symbols_cache_add_symbol_virtual (cfg->cache, bit->symbol,
- 1, parent_id);
+ rspamd_symbols_cache_add_symbol (cfg->cache, bit->symbol,
+ 0, NULL, NULL,
+ SYMBOL_TYPE_VIRTUAL, parent_id);
}
}
else {
- rspamd_symbols_cache_add_symbol_virtual (cfg->cache, suffix->symbol,
- 1, parent_id);
+ rspamd_symbols_cache_add_symbol (cfg->cache, suffix->symbol,
+ 0, NULL, NULL,
+ SYMBOL_TYPE_VIRTUAL, parent_id);
}
}
@@ -371,7 +374,7 @@ surbl_module_config (struct rspamd_config *cfg)
surbl_module_ctx->redirector_symbol = ucl_obj_tostring (value);
rspamd_symbols_cache_add_symbol (cfg->cache,
surbl_module_ctx->redirector_symbol,
- 1.0, 0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
+ 0, NULL, NULL, SYMBOL_TYPE_COMPOSITE, -1);
}
else {
surbl_module_ctx->redirector_symbol = NULL;
@@ -486,10 +489,13 @@ surbl_module_config (struct rspamd_config *cfg)
}
}
- cb_id = rspamd_symbols_cache_add_symbol_callback (cfg->cache,
- 1,
- surbl_test_url,
- new_suffix);
+ cb_id = rspamd_symbols_cache_add_symbol (cfg->cache,
+ "SURBL_CALLBACK",
+ 0,
+ surbl_test_url,
+ new_suffix,
+ SYMBOL_TYPE_CALLBACK,
+ -1);
new_suffix->callback_id = cb_id;
has_subsymbols = FALSE;
@@ -572,9 +578,11 @@ surbl_module_config (struct rspamd_config *cfg)
if (!has_subsymbols) {
/* Register just a symbol itself */
- rspamd_symbols_cache_add_symbol_virtual (cfg->cache,
+ rspamd_symbols_cache_add_symbol (cfg->cache,
new_suffix->symbol,
- 1,
+ 0,
+ NULL, NULL,
+ SYMBOL_TYPE_VIRTUAL,
cb_id);
}
surbl_module_ctx->suffixes = g_list_prepend (