From 4bc4b010cfb465397c1ef995472be7fcd0cb5b09 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Mon, 22 Jun 2015 21:40:21 +0200 Subject: Add whitelist_exception setting to RBL module --- src/plugins/lua/rbl.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/plugins/lua/rbl.lua') diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index cceb00449..c524c5bf1 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -355,7 +355,22 @@ for key,rbl in pairs(opts['rbls']) do if type(rspamd_config.get_api_version) ~= 'nil' then rspamd_config:register_virtual_symbol(s, 1, id) if(rbl['is_whitelist']) then - table.insert(white_symbols, s) + if type(rbl['whitelist_exception']) == 'string' then + if (rbl['whitelist_exception'] ~= s) then + table.insert(white_symbols, s) + end + elseif type(rbl['whitelist_exception']) == 'table' then + local foundException = false + for _, e in pairs(rbl['whitelist_exception']) do + if e == s then + foundException = true + break + end + end + if not foundException then + table.insert(white_symbols, s) + end + end else table.insert(black_symbols, s) end -- cgit v1.2.3