]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Allow to disable fuzzy rules
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 25 May 2020 19:40:44 +0000 (20:40 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 25 May 2020 19:40:44 +0000 (20:40 +0100)
src/plugins/fuzzy_check.c

index 3a0827a92aa1906ab906caff438875cf9e9b6ea6..36e093836962957a282c779d070f08118f6994da 100644 (file)
@@ -346,6 +346,14 @@ fuzzy_parse_rule (struct rspamd_config *cfg, const ucl_object_t *obj,
                return -1;
        }
 
+       if ((value = ucl_object_lookup_any (obj, "enabled", "enable", NULL)) != NULL) {
+               if (!ucl_object_toboolean (value)) {
+                       msg_info_config ("fuzzy rule %s is disabled by configuration", name);
+
+                       return 0;
+               }
+       }
+
        rule = fuzzy_rule_new (fuzzy_module_ctx->default_symbol,
                        cfg->cfg_pool);
        rule->ucl_obj = obj;