]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix surbl plugin to work with composite maps
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 9 Jan 2017 17:32:18 +0000 (17:32 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 9 Jan 2017 17:32:18 +0000 (17:32 +0000)
src/plugins/surbl.c
src/plugins/surbl.h

index 92741da5e35e2dc8b2f333035fe852aa1cf99479..1a2d06c1294edd2a58abec4107519ba68f801709 100644 (file)
@@ -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);
index 8e14441b483bb0c8a451d93662572cbdf168295c..16a6878e28b4488519593dfb4c083df9b3985973 100644 (file)
@@ -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;