From 50466eddf26c21c999eb2065c49072e6012922a3 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 27 Aug 2019 11:28:17 +0100 Subject: [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 -- cgit v1.2.3