From 66005f3fa335c9f9acc37a7315ec5ab5d3abde66 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 8 Nov 2019 15:44:36 +0000 Subject: [Feature] Allow to disable symbols from the metric config --- src/lua/lua_config.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/lua') diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index b7bddc34b..9a2d2f55d 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -2318,7 +2318,7 @@ lua_config_set_metric_symbol (lua_State * L) nshots = 1; } if (strstr (flags_str, "ignore") != NULL) { - flags |= RSPAMD_SYMBOL_FLAG_IGNORE; + flags |= RSPAMD_SYMBOL_FLAG_IGNORE_METRIC; } if (strstr (flags_str, "one_param") != NULL) { flags |= RSPAMD_SYMBOL_FLAG_ONEPARAM; @@ -3376,7 +3376,7 @@ lua_metric_symbol_inserter (gpointer k, gpointer v, gpointer ud) lua_pushstring (L, "flags"); lua_createtable (L, 0, 3); - if (s->flags & RSPAMD_SYMBOL_FLAG_IGNORE) { + if (s->flags & RSPAMD_SYMBOL_FLAG_IGNORE_METRIC) { lua_pushstring (L, "ignore"); lua_pushboolean (L, true); lua_settable (L, -3); @@ -3391,6 +3391,11 @@ lua_metric_symbol_inserter (gpointer k, gpointer v, gpointer ud) lua_pushboolean (L, true); lua_settable (L, -3); } + if (s->flags & RSPAMD_SYMBOL_FLAG_DISABLED) { + lua_pushstring (L, "disabled"); + lua_pushboolean (L, true); + lua_settable (L, -3); + } if (s->cache_item) { guint sflags = rspamd_symcache_get_symbol_flags (cbd->cfg->cache, sym); -- cgit v1.2.3