aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-25 20:40:44 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-25 20:40:44 +0100
commit1720649d9a7372bd38ba9958138ce0c58a0d5762 (patch)
tree3da4244c674a89ed373c66e498a191b96116bd55
parent967ee15c9ac05fc51f3cad370f18211947896968 (diff)
downloadrspamd-1720649d9a7372bd38ba9958138ce0c58a0d5762.tar.gz
rspamd-1720649d9a7372bd38ba9958138ce0c58a0d5762.zip
[Minor] Allow to disable fuzzy rules
-rw-r--r--src/plugins/fuzzy_check.c8
1 files changed, 8 insertions, 0 deletions
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;