aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-12-18 17:02:16 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-12-18 17:02:16 +0200
commit8b8bbde1fe15d4d4fe220e63f4dd0b48aafbfba7 (patch)
tree5e94394fc42c57950405e50c1d280fc450f543ec
parent6f3185a4eb6d9916ff1f6dccda38f14aeaed7241 (diff)
downloadrspamd-8b8bbde1fe15d4d4fe220e63f4dd0b48aafbfba7.tar.gz
rspamd-8b8bbde1fe15d4d4fe220e63f4dd0b48aafbfba7.zip
[Fix] RBL: received: deal with missing data (#1965)
-rw-r--r--src/plugins/lua/rbl.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua
index 82c1fb975..a2ce4356c 100644
--- a/src/plugins/lua/rbl.lua
+++ b/src/plugins/lua/rbl.lua
@@ -93,6 +93,7 @@ local function gen_check_rcvd_conditions(rbl, received_total)
local match_flags = rbl['received_flags']
local nmatch_flags = rbl['received_nflags']
local function basic_received_check(rh)
+ if not (rh['real_ip'] and rh['real_ip']:is_valid()) then return false end
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 rh['real_ip']:is_local()) or
@@ -108,7 +109,7 @@ local function gen_check_rcvd_conditions(rbl, received_total)
end
return function(rh, pos)
if not basic_received_check() then return false end
- local got_flags = rh['flags']
+ local got_flags = rh['flags'] or E
if min_pos then
if min_pos < 0 then
if min_pos == -1 then