summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2015-02-16 17:39:39 +0200
committerAndrew Lewis <nerf@judo.za.org>2015-02-16 20:00:48 +0200
commitf239a10d2ecdf959ef0b8e4151af3aa49419eaeb (patch)
tree83b75f8becd368905e44d60aef9b1741c5c04c4e /src
parentda3dbe0097d601578fe4c463ead551b4f4ea14ba (diff)
downloadrspamd-f239a10d2ecdf959ef0b8e4151af3aa49419eaeb.tar.gz
rspamd-f239a10d2ecdf959ef0b8e4151af3aa49419eaeb.zip
Fix incorrect processing of exclusions
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/rbl.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index ab00ade64..82955f13c 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -178,13 +178,15 @@ local function rbl_cb (task)
end
if not havegot['from'] then
havegot['from'] = task:get_from_ip()
- if not havegot['from']:is_valid() or
- (rbl['exclude_private_ips'] and is_private_ip(havegot['from']))
- or (is_excluded_ip(havegot['from']) and rbl['exclude_local']) then
+ if not havegot['from']:is_valid() then
notgot['from'] = true
return
end
end
+ if (rbl['exclude_private_ips'] and is_private_ip(havegot['from']))
+ or (is_excluded_ip(havegot['from']) and rbl['exclude_local']) then
+ return
+ end
if (havegot['from']:get_version() == 6 and rbl['ipv6']) or
(havegot['from']:get_version() == 4 and rbl['ipv4']) then
task:get_resolver():resolve_a(task:get_session(), task:get_mempool(),
@@ -210,8 +212,8 @@ local function rbl_cb (task)
if ((rh['real_ip']:get_version() == 6 and rbl['ipv6']) or
(rh['real_ip']:get_version() == 4 and rbl['ipv4'])) and
((rbl['exclude_private_ips'] and not is_private_ip(rh['real_ip'])) or
- not rbl['exclude_private_ips']) and not (is_excluded_ip(rh['real_ip'])
- or not rbl['exclude_local']) then
+ not rbl['exclude_private_ips']) and ((rbl['exclude_local_ips'] and
+ not is_excluded_ip(rh['real_ip'])) or not rbl['exclude_local_ips']) then
task:get_resolver():resolve_a(task:get_session(), task:get_mempool(),
ip_to_rbl(rh['real_ip'], rbl['rbl']), rbl_dns_cb, k)
end