summaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-04-06 14:59:07 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-04-06 14:59:07 +0100
commitebc1286073fb291de96adc97e5305234cfb3b6c0 (patch)
tree3e562e735be27e6300b7643304a03f3f8cb61181 /lualib
parent2599241bba1788d902398a637d6657e816193c21 (diff)
downloadrspamd-ebc1286073fb291de96adc97e5305234cfb3b6c0.tar.gz
rspamd-ebc1286073fb291de96adc97e5305234cfb3b6c0.zip
[Minor] Slightly extend 'forbidden' flags
Diffstat (limited to 'lualib')
-rw-r--r--lualib/rspamadm/clickhouse.lua16
1 files changed, 14 insertions, 2 deletions
diff --git a/lualib/rspamadm/clickhouse.lua b/lualib/rspamadm/clickhouse.lua
index 2571664a8..3f9a7cb73 100644
--- a/lualib/rspamadm/clickhouse.lua
+++ b/lualib/rspamadm/clickhouse.lua
@@ -169,6 +169,12 @@ local function get_excluded_symbols(known_symbols, correlations, seen_total)
local known_symbols_list = {}
local composites = rspamd_config:get_all_opt('composites')
local all_symbols = rspamd_config:get_symbols()
+ local skip_flags = {
+ nostat = true,
+ skip = true,
+ idempotent = true,
+ composite = true,
+ }
for k, v in pairs(known_symbols) do
local lower_count, higher_count
if v.seen_spam > v.seen_ham then
@@ -178,10 +184,16 @@ local function get_excluded_symbols(known_symbols, correlations, seen_total)
lower_count = v.seen_spam
higher_count = v.seen_ham
end
+
if composites[k] then
remove[k] = 'composite symbol'
- elseif (all_symbols[k] or {flags = {}}).flags.nostat then
- remove[k] = 'nostat symbol'
+ elseif all_symbols[k] then
+ for fl,_ in pairs(all_symbols[k].flags or {}) do
+ if skip_flags[fl] then
+ remove[k] = fl .. ' symbol'
+ break
+ end
+ end
elseif lower_count / higher_count >= 0.95 then
remove[k] = 'weak ham/spam correlation'
elseif v.seen / seen_total >= 0.9 then