aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-05 10:46:14 +0000
committerGitHub <noreply@github.com>2016-12-05 10:46:14 +0000
commit1671791bcafeb89ec558988d8b7f04e53b6099db (patch)
tree6799c566b59452d820ab2d96c875a9e2383f9fa2
parent065f4f64f16ea0df8a34a9dd59b7f120976b783d (diff)
parent69f860a088812c2002a094cd6622abad46cc9169 (diff)
downloadrspamd-1671791bcafeb89ec558988d8b7f04e53b6099db.tar.gz
rspamd-1671791bcafeb89ec558988d8b7f04e53b6099db.zip
Merge pull request #1223 from fatalbanana/surbl
[Feature] Add toggle for disabling SURBLs
-rw-r--r--src/plugins/surbl.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c
index f364ce64d..6dea0b939 100644
--- a/src/plugins/surbl.c
+++ b/src/plugins/surbl.c
@@ -376,6 +376,15 @@ surbl_module_init (struct rspamd_config *cfg, struct module_ctx **ctx)
0);
rspamd_rcl_add_doc_by_path (cfg,
"surbl.rule",
+ "Whether the defined rule should be used",
+ "enabled",
+ UCL_BOOLEAN,
+ NULL,
+ 0,
+ NULL,
+ 0);
+ rspamd_rcl_add_doc_by_path (cfg,
+ "surbl.rule",
"Do not try to check URLs with IP address instead of hostname",
"no_ip",
UCL_BOOLEAN,
@@ -474,6 +483,12 @@ surbl_module_parse_rule (const ucl_object_t* value, struct rspamd_config* cfg,
struct surbl_bit_item* new_bit;
LL_FOREACH(value, cur_rule) {
+ cur = ucl_object_lookup (cur_rule, "enabled");
+ if (cur != NULL && cur->type == UCL_BOOLEAN) {
+ if (!ucl_object_toboolean(cur)) {
+ continue;
+ }
+ }
cur = ucl_object_lookup (cur_rule, "suffix");
if (cur == NULL) {
msg_err_config("surbl rule must have explicit symbol "