aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-23 16:36:18 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-23 16:36:18 +0100
commit07c0b80530f9b6ff44c014574ec48bb699b60261 (patch)
treedb6ba0d0aca129808c0b036c80a41883e65f9b0d /src
parent1dfa377015030cf47a8b0c1d19d2c6fec6c10201 (diff)
parentb077a882599d6f0a7ead3203509cb65218300150 (diff)
downloadrspamd-07c0b80530f9b6ff44c014574ec48bb699b60261.tar.gz
rspamd-07c0b80530f9b6ff44c014574ec48bb699b60261.zip
Merge pull request #303 from fatalbanana/master
rbl.lua: Fix issues with application of whitelists
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/rbl.lua25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index c524c5bf1..62d1a8bd9 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -370,9 +370,13 @@ for key,rbl in pairs(opts['rbls']) do
if not foundException then
table.insert(white_symbols, s)
end
+ else
+ table.insert(white_symbols, s)
end
else
- table.insert(black_symbols, s)
+ if rbl['ignore_whitelists'] == false then
+ table.insert(black_symbols, s)
+ end
end
end
end
@@ -383,7 +387,24 @@ for key,rbl in pairs(opts['rbls']) do
if type(rspamd_config.get_api_version) ~= 'nil' and rbl['symbol'] then
rspamd_config:register_virtual_symbol(rbl['symbol'], 1, id)
if(rbl['is_whitelist']) then
- table.insert(white_symbols, rbl['symbol'])
+ if type(rbl['whitelist_exception']) == 'string' then
+ if (rbl['whitelist_exception'] ~= rbl['symbol']) then
+ table.insert(white_symbols, rbl['symbol'])
+ 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, rbl['symbol'])
+ end
+ else
+ table.insert(white_symbols, rbl['symbol'])
+ end
else
if rbl['ignore_whitelists'] == false then
table.insert(black_symbols, rbl['symbol'])