commit 447681f: [Minor] Add more whitelists debugging

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Apr 20 15:28:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-04-20 16:22:54 +0100
URL: https://github.com/rspamd/rspamd/commit/447681fc808436f82b76016b8212697400843094

[Minor] Add more whitelists debugging

---
 src/plugins/lua/rbl.lua | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index 1e339b1f5..44d718d9e 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -282,7 +282,12 @@ end
 
 local function gen_rbl_callback(rule)
   local function is_whitelisted(task, req, req_str, whitelist, what)
-    if rule.ignore_whitelist then return false end
+    if rule.ignore_whitelist then
+      lua_util.debugm(N, task,
+          'ignore whitelisting checks to %s by %s: ignore whitelist is being set',
+          req_str, rule.symbol)
+      return false
+    end
 
     if rule.whitelist then
       if rule.whitelist:get_key(req) then
@@ -951,6 +956,10 @@ local function add_rbl(key, rbl, global_opts)
       end
       if not rbl.is_whitelist and rbl.ignore_whitelist == false then
         table.insert(black_symbols, rbl.symbol .. '_CHECK')
+      else
+        lua_util.debugm(N, rspamd_config, 'rule %s ignores whitelists: rbl.is_whitelist = %s, ' ..
+            'rbl.ignore_whitelist = %s',
+            rbl.symbol, rbl.is_whitelist, rbl.ignore_whitelist)
       end
     else
       id = rspamd_config:register_symbol{


More information about the Commits mailing list