commit 1720649: [Minor] Allow to disable fuzzy rules

Vsevolod Stakhov vsevolod at highsecure.ru
Mon May 25 19:42:08 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-05-25 20:40:44 +0100
URL: https://github.com/rspamd/rspamd/commit/1720649d9a7372bd38ba9958138ce0c58a0d5762 (HEAD -> master)

[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;


More information about the Commits mailing list