diff options
author | Andrew Lewis <nerf@judo.za.org> | 2016-12-05 12:29:17 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2016-12-05 12:30:51 +0200 |
commit | 69f860a088812c2002a094cd6622abad46cc9169 (patch) | |
tree | 6799c566b59452d820ab2d96c875a9e2383f9fa2 /src/plugins/surbl.c | |
parent | 065f4f64f16ea0df8a34a9dd59b7f120976b783d (diff) | |
download | rspamd-69f860a088812c2002a094cd6622abad46cc9169.tar.gz rspamd-69f860a088812c2002a094cd6622abad46cc9169.zip |
[Feature] Add toggle for disabling SURBLs
Diffstat (limited to 'src/plugins/surbl.c')
-rw-r--r-- | src/plugins/surbl.c | 15 |
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 " |