From 5593d60f901f071e47b28fb850a37f603ddbe1d9 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Thu, 23 Feb 2017 15:26:43 +0200 Subject: [PATCH] [Minor] Support setting `enabled = false` on RBLs --- src/plugins/lua/rbl.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index 5fde08b69..ec1958fe1 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -439,6 +439,7 @@ end -- Plugin defaults should not be changed - override these in config -- New defaults should not alter behaviour local default_defaults = { + ['default_enabled'] = {[1] = true, [2] = 'enabled'}, ['default_ipv4'] = {[1] = true, [2] = 'ipv4'}, ['default_ipv6'] = {[1] = false, [2] = 'ipv6'}, ['default_received'] = {[1] = true, [2] = 'received'}, @@ -484,6 +485,7 @@ for key,rbl in pairs(opts['rbls']) do rbl[default_v[2]] = opts[default] end end + if not rbl['enabled'] then return end if type(rbl['returncodes']) == 'table' then for s,_ in pairs(rbl['returncodes']) do if type(rspamd_config.get_api_version) ~= 'nil' then -- 2.39.5