From ebc1286073fb291de96adc97e5305234cfb3b6c0 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 6 Apr 2021 14:59:07 +0100 Subject: [PATCH] [Minor] Slightly extend 'forbidden' flags --- lualib/rspamadm/clickhouse.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lualib/rspamadm/clickhouse.lua b/lualib/rspamadm/clickhouse.lua index 2571664a86..3f9a7cb731 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 -- 2.47.3