diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-08-06 18:25:15 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-08-06 18:25:15 +0100 |
commit | d9c16b50a4f7607cb5f4887fcc3c988f7c28d181 (patch) | |
tree | 4284c8de0a956a30ed70f92c65e24b9da0df5115 /src/plugins | |
parent | 54becee5b29dfc2cbda278a7f016fa62eceb996a (diff) | |
download | rspamd-d9c16b50a4f7607cb5f4887fcc3c988f7c28d181.tar.gz rspamd-d9c16b50a4f7607cb5f4887fcc3c988f7c28d181.zip |
Add conditional enabling of modules.
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/chartable.c | 4 | ||||
-rw-r--r-- | src/plugins/dkim_check.c | 4 | ||||
-rw-r--r-- | src/plugins/fuzzy_check.c | 4 | ||||
-rw-r--r-- | src/plugins/regexp.c | 4 | ||||
-rw-r--r-- | src/plugins/spf.c | 4 | ||||
-rw-r--r-- | src/plugins/surbl.c | 4 |
6 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c index cafef6d40..c0c68f71a 100644 --- a/src/plugins/chartable.c +++ b/src/plugins/chartable.c @@ -82,6 +82,10 @@ chartable_module_config (struct rspamd_config *cfg) const ucl_object_t *value; gint res = TRUE; + if (!rspamd_config_is_module_enabled (cfg, "chartable")) { + return TRUE; + } + if ((value = rspamd_config_get_module_opt (cfg, "chartable", "symbol")) != NULL) { chartable_module_ctx->symbol = ucl_obj_tostring (value); diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c index 477a1bc29..e30b9858c 100644 --- a/src/plugins/dkim_check.c +++ b/src/plugins/dkim_check.c @@ -116,6 +116,10 @@ dkim_module_config (struct rspamd_config *cfg) guint cache_size, cache_expire; gboolean got_trusted = FALSE; + if (!rspamd_config_is_module_enabled (cfg, "dkim")) { + return TRUE; + } + dkim_module_ctx->whitelist_ip = radix_create_compressed (); if ((value = diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 5d1ebe316..783b9393f 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -417,6 +417,10 @@ fuzzy_check_module_config (struct rspamd_config *cfg) const ucl_object_t *value, *cur; gint res = TRUE, cb_id; + if (!rspamd_config_is_module_enabled (cfg, "fuzzy_check")) { + return TRUE; + } + if ((value = rspamd_config_get_module_opt (cfg, "fuzzy_check", "symbol")) != NULL) { fuzzy_module_ctx->default_symbol = ucl_obj_tostring (value); diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index da2caab4a..ed677ce98 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -114,6 +114,10 @@ regexp_module_config (struct rspamd_config *cfg) ucl_object_iter_t it = NULL; gint res = TRUE; + if (!rspamd_config_is_module_enabled (cfg, "regexp")) { + return TRUE; + } + sec = ucl_object_find_key (cfg->rcl_obj, "regexp"); if (sec == NULL) { msg_err ("regexp module enabled, but no rules are defined"); diff --git a/src/plugins/spf.c b/src/plugins/spf.c index d0998b05d..caff118e4 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -108,6 +108,10 @@ spf_module_config (struct rspamd_config *cfg) gint res = TRUE, cb_id; guint cache_size, cache_expire; + if (!rspamd_config_is_module_enabled (cfg, "spf")) { + return TRUE; + } + spf_module_ctx->whitelist_ip = radix_create_compressed (); if ((value = diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 23beb1fbc..997115d6d 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -346,6 +346,10 @@ surbl_module_config (struct rspamd_config *cfg) gint cb_id; gboolean has_subsymbols; + if (!rspamd_config_is_module_enabled (cfg, "surbl")) { + return TRUE; + } + if ((value = rspamd_config_get_module_opt (cfg, "surbl", "redirector")) != NULL) { surbl_module_ctx->redirectors = rspamd_upstreams_create (); |