From 1720649d9a7372bd38ba9958138ce0c58a0d5762 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 25 May 2020 20:40:44 +0100 Subject: [PATCH] [Minor] Allow to disable fuzzy rules --- src/plugins/fuzzy_check.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index 3a0827a92..36e093836 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -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; -- 2.39.5