]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] DMARC: fix runaway processing in reporting address verification
authorAndrew Lewis <nerf@judo.za.org>
Fri, 19 May 2017 15:38:34 +0000 (17:38 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 29 May 2017 09:15:11 +0000 (11:15 +0200)
src/plugins/lua/dmarc.lua

index 4b4f4c33dc8d196ef127973ba8bdc9f5be90ffc1..b712d0f53c7718a7e260229a4155c4bdd2d455c8 100644 (file)
@@ -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)