From: Vsevolod Stakhov Date: Mon, 9 Jan 2017 17:32:18 +0000 (+0000) Subject: [Fix] Fix surbl plugin to work with composite maps X-Git-Tag: 1.5.0~393 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cba7b857e410abbb818fafe472a282c53f82fd1b;p=thirdparty%2Frspamd.git [Fix] Fix surbl plugin to work with composite maps --- diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 92741da5e3..1a2d06c129 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 8e14441b48..16a6878e28 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;