diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-28 18:59:46 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-28 18:59:46 +0100 |
commit | 70fe412fc5da55f3bd4e1ddeb03eace189d355c3 (patch) | |
tree | f9484efd77377b7020efe207b172e0de98423705 /src/plugins/lua | |
parent | 53478ca1ff6b3d1603cae2cc7d84a3d35dc815d7 (diff) | |
download | rspamd-70fe412fc5da55f3bd4e1ddeb03eace189d355c3.tar.gz rspamd-70fe412fc5da55f3bd4e1ddeb03eace189d355c3.zip |
[Fix] Do not fail rbl plugin when there are no received or emails
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/rbl.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index a6b54539e..55f2bffea 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -159,7 +159,10 @@ local function rbl_cb (task) return params[to_resolve] end - local havegot = {} + local havegot = { + emails = {}, + received = {} + } local notgot = {} local alive_rbls = fun.filter(function(_, rbl) @@ -242,10 +245,11 @@ local function rbl_cb (task) if notgot['emails'] then return false end - if not havegot['emails'] then + if #havegot['emails'] == 0 then havegot['emails'] = task:get_emails() if havegot['emails'] == nil then notgot['emails'] = true + havegot['emails'] = {} return false end end @@ -264,10 +268,11 @@ local function rbl_cb (task) if notgot['received'] then return false end - if not havegot['received'] then + if #havegot['received'] == 0 then havegot['received'] = task:get_received_headers() if next(havegot['received']) == nil then notgot['received'] = true + havegot['received'] = {} return false end end |