]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Slightly extend 'forbidden' flags
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 6 Apr 2021 13:59:07 +0000 (14:59 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 6 Apr 2021 13:59:07 +0000 (14:59 +0100)
lualib/rspamadm/clickhouse.lua

index 2571664a86e5df2bea9711955e028c376ae29a47..3f9a7cb73181e1ccd535be56d8c82addc896bbcd 100644 (file)
@@ -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