aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-08 15:44:36 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-11-08 15:44:36 +0000
commit66005f3fa335c9f9acc37a7315ec5ab5d3abde66 (patch)
tree658ee4eba23793133b6cfc137282613feb28479b /src/lua
parente69038f5a663de4f1815796a5cb74d752d78a2a8 (diff)
downloadrspamd-66005f3fa335c9f9acc37a7315ec5ab5d3abde66.tar.gz
rspamd-66005f3fa335c9f9acc37a7315ec5ab5d3abde66.zip
[Feature] Allow to disable symbols from the metric config
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_config.c9
1 files changed, 7 insertions, 2 deletions
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);