]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Add toggle for disabling SURBLs 1223/head
authorAndrew Lewis <nerf@judo.za.org>
Mon, 5 Dec 2016 10:29:17 +0000 (12:29 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 5 Dec 2016 10:30:51 +0000 (12:30 +0200)
src/plugins/surbl.c

index f364ce64d579c2942c5560f775d776aca288152b..6dea0b939a6506eee863b3b21b5f16660a35ecb6 100644 (file)
@@ -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 "