From: Vsevolod Stakhov Date: Tue, 27 Aug 2019 10:28:17 +0000 (+0100) Subject: [Minor] Rbl: Allow rules to ignore defaults X-Git-Tag: 2.0~337 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=50466eddf26c21c999eb2065c49072e6012922a3;p=rspamd.git [Minor] Rbl: Allow rules to ignore defaults --- 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