commit 50466ed: [Minor] Rbl: Allow rules to ignore defaults

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Aug 27 17:49:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-08-27 11:28:17 +0100
URL: https://github.com/rspamd/rspamd/commit/50466eddf26c21c999eb2065c49072e6012922a3

[Minor] Rbl: Allow rules to ignore defaults

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

diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index 4cafb0c87..00a35e1d7 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -850,10 +850,12 @@ for key,rbl in pairs(opts.rbls or opts.rules) do
     rspamd_logger.infox(rspamd_config, 'disable rbl "%s"', key)
   else
     -- Propagate default options from opts to rule
-    for default_opt_key,_ in pairs(default_options) do
-      local rbl_opt = default_opt_key:sub(#('default_') + 1)
-      if rbl[rbl_opt] == nil then
-        rbl[rbl_opt] = opts[default_opt_key]
+    if not rbl.ignore_defaults then
+      for default_opt_key,_ in pairs(default_options) do
+        local rbl_opt = default_opt_key:sub(#('default_') + 1)
+        if rbl[rbl_opt] == nil then
+          rbl[rbl_opt] = opts[default_opt_key]
+        end
       end
     end
 


More information about the Commits mailing list