From: Andrew Lewis Date: Fri, 19 May 2017 15:38:34 +0000 (+0200) Subject: [Minor] DMARC: fix runaway processing in reporting address verification X-Git-Tag: 1.6.0~106 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5f7d94353bbc32d75c02a75a1fed99cc4001187d;p=rspamd.git [Minor] DMARC: fix runaway processing in reporting address verification --- diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 4b4f4c33d..b712d0f53 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -957,22 +957,24 @@ if opts['reporting'] == true then to_verify[test_addr] = nil reporting_addr[test_addr] = true end - if not next(to_verify) then - if next(reporting_addr) then - make_report() - else - rspamd_logger.infox(rspamd_config, 'No valid reporting addresses for %s', reporting_domain) - delete_reports() - end + end + local t, vdom = next(to_verify) + if not t then + if next(reporting_addr) then + make_report() + else + rspamd_logger.infox(rspamd_config, 'No valid reporting addresses for %s', reporting_domain) + delete_reports() end + else + verifier(t, vdom) end end rspamd_config:get_resolver():resolve_txt(nil, pool, string.format('%s._report._dmarc.%s', reporting_domain, vdom), verify_cb) end - for t, vdom in pairs(to_verify) do - verifier(t, vdom) - end + local t, vdom = next(to_verify) + verifier(t, vdom) end local function get_reporting_address() local function check_addr_cb(resolver, to_resolve, results, err, _, authenticated)