From 69f860a088812c2002a094cd6622abad46cc9169 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Mon, 5 Dec 2016 12:29:17 +0200 Subject: [PATCH] [Feature] Add toggle for disabling SURBLs --- src/plugins/surbl.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 @@ -374,6 +374,15 @@ surbl_module_init (struct rspamd_config *cfg, struct module_ctx **ctx) 0, NULL, 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", @@ -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 " -- 2.39.5