]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] RBL: received: deal with missing data (#1965)
authorAndrew Lewis <nerf@judo.za.org>
Mon, 18 Dec 2017 15:02:16 +0000 (17:02 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 18 Dec 2017 15:02:16 +0000 (17:02 +0200)
src/plugins/lua/rbl.lua

index 82c1fb9755eacae4c520a7acbbabf4258d074ac2..a2ce4356c5f3b1681d59dfa9b82c7326b64c14b5 100644 (file)
@@ -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