commit ad08658: [Minor] Rbl: Improve WL logging

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Sep 19 08:35:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-09-19 09:31:14 +0100
URL: https://github.com/rspamd/rspamd/commit/ad086586a46cd1bd73002643351d04131949b4cd (HEAD -> master)

[Minor] Rbl: Improve WL logging

---
 src/plugins/lua/rbl.lua | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index 418c174ba..7d9b9f71b 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -824,7 +824,8 @@ local function add_rbl(key, rbl, global_opts)
     if ret then
       rbl.process_script = f
     else
-      rspamd_logger.errx('invalid process script for rbl rule %s: %s; %s',
+      rspamd_logger.errx(rspamd_config,
+          'invalid process script for rbl rule %s: %s; %s',
           key, rbl.process_script, f)
       return false
     end
@@ -837,13 +838,18 @@ local function add_rbl(key, rbl, global_opts)
     end
     rbl.whitelist = lua_maps.map_add_from_ucl(rbl.whitelist, def_type,
         'RBL whitelist for ' .. rbl.symbol)
+    rspamd_logger.infox(rspamd_config, 'added %s whitelist for RBL %s',
+        def_type, rbl.symbol)
   end
 
   if not rbl.whitelist and global_opts.url_whitelist and
-      (rbl.urls or rbl.emails or rbl.dkim or rbl.replyto) then
+      (rbl.urls or rbl.emails or rbl.dkim or rbl.replyto) and
+      not (rbl.from or rbl.received) then
     local def_type = 'set'
     rbl.whitelist = lua_maps.map_add_from_ucl(global_opts.url_whitelist, def_type,
         'RBL url whitelist for ' .. rbl.symbol)
+    rspamd_logger.infox(rspamd_config, 'added URL whitelist for RBL %s',
+        rbl.symbol)
   end
 
   local callback,description = gen_rbl_callback(rbl)


More information about the Commits mailing list