diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-09 17:32:18 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-09 17:32:18 +0000 |
commit | cba7b857e410abbb818fafe472a282c53f82fd1b (patch) | |
tree | f6b08d863c98efb47ac3a7499f6d0d0dc9135cc4 | |
parent | b6d181c683ed32a67f704f1b022c78651cd88082 (diff) | |
download | rspamd-cba7b857e410abbb818fafe472a282c53f82fd1b.tar.gz rspamd-cba7b857e410abbb818fafe472a282c53f82fd1b.zip |
[Fix] Fix surbl plugin to work with composite maps
-rw-r--r-- | src/plugins/surbl.c | 25 | ||||
-rw-r--r-- | src/plugins/surbl.h | 2 |
2 files changed, 7 insertions, 20 deletions
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 92741da5e..1a2d06c12 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -260,8 +260,6 @@ surbl_module_init (struct rspamd_config *cfg, struct module_ctx **ctx) surbl_module_ctx->suffixes = NULL; surbl_module_ctx->surbl_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL); - surbl_module_ctx->tld2_file = NULL; - surbl_module_ctx->whitelist_file = NULL; surbl_module_ctx->redirectors = NULL; surbl_module_ctx->whitelist = g_hash_table_new (rspamd_strcase_hash, rspamd_strcase_equal); @@ -755,23 +753,16 @@ surbl_module_config (struct rspamd_config *cfg) } if ((value = rspamd_config_get_module_opt (cfg, "surbl", "exceptions")) != NULL) { - if (rspamd_map_add_from_ucl (cfg, value, - "SURBL exceptions list", read_exceptions_list, fin_exceptions_list, - (void **)&surbl_module_ctx->exceptions)) { - surbl_module_ctx->tld2_file = rspamd_mempool_strdup ( - surbl_module_ctx->surbl_pool, - ucl_obj_tostring (value) + sizeof ("file://") - 1); - } + rspamd_map_add_from_ucl (cfg, value, + "SURBL exceptions list", + read_exceptions_list, fin_exceptions_list, + (void **)&surbl_module_ctx->exceptions); } if ((value = rspamd_config_get_module_opt (cfg, "surbl", "whitelist")) != NULL) { - if (rspamd_map_add_from_ucl (cfg, value, - "SURBL whitelist", rspamd_hosts_read, rspamd_hosts_fin, - (void **)&surbl_module_ctx->whitelist)) { - surbl_module_ctx->whitelist_file = rspamd_mempool_strdup ( - surbl_module_ctx->surbl_pool, - ucl_obj_tostring (value) + sizeof ("file://") - 1); - } + rspamd_map_add_from_ucl (cfg, value, + "SURBL whitelist", rspamd_hosts_read, rspamd_hosts_fin, + (void **)&surbl_module_ctx->whitelist); } value = rspamd_config_get_module_opt (cfg, "surbl", "rule"); @@ -841,8 +832,6 @@ surbl_module_reconfig (struct rspamd_config *cfg) surbl_module_ctx->suffixes = NULL; surbl_module_ctx->surbl_pool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL); - surbl_module_ctx->tld2_file = NULL; - surbl_module_ctx->whitelist_file = NULL; surbl_module_ctx->redirectors = NULL; surbl_module_ctx->whitelist = g_hash_table_new (rspamd_strcase_hash, rspamd_strcase_equal); diff --git a/src/plugins/surbl.h b/src/plugins/surbl.h index 8e14441b4..16a6878e2 100644 --- a/src/plugins/surbl.h +++ b/src/plugins/surbl.h @@ -27,8 +27,6 @@ struct surbl_ctx { guint url_expire; GList *suffixes; gchar *metric; - const gchar *tld2_file; - const gchar *whitelist_file; const gchar *redirector_symbol; GHashTable **exceptions; GHashTable *whitelist; |