commit 1171b24: [Minor] Slightly improve readability

Vsevolod Stakhov vsevolod at rspamd.com
Mon Sep 19 12:49:06 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-09-19 13:46:26 +0100
URL: https://github.com/rspamd/rspamd/commit/1171b24a822280d0b04b7a5ed952c83034e19664 (HEAD -> master)

[Minor] Slightly improve readability

---
 lualib/rspamadm/dmarc_report.lua | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lualib/rspamadm/dmarc_report.lua b/lualib/rspamadm/dmarc_report.lua
index 85c905130..c81be13cf 100644
--- a/lualib/rspamadm/dmarc_report.lua
+++ b/lualib/rspamadm/dmarc_report.lua
@@ -291,8 +291,8 @@ local function process_rua(dmarc_domain, rua)
 
   -- Remove size limitation, as we don't care about them
   local addrs = {}
-  for _,a in ipairs(parts) do
-    local u = rspamd_url.create(pool, a:gsub('!%d+[kmg]?$', ''))
+  for _, rua_part in ipairs(parts) do
+    local u = rspamd_url.create(pool, rua_part:gsub('!%d+[kmg]?$', ''))
     if u and (u:get_protocol() or '') == 'mailto' and u:get_user() then
       -- Check each address for sanity
       if dmarc_domain == u:get_tld() or dmarc_domain == u:get_host() then
@@ -310,7 +310,7 @@ local function process_rua(dmarc_domain, rua)
         })
 
         if not is_ok then
-          logger.errx('cannot resolve %s: %s; exclude %s', resolve_str, results, a)
+          logger.errx('cannot resolve %s: %s; exclude %s', resolve_str, results, rua_part)
         else
           local found = false
           for _,t in ipairs(results) do
@@ -440,7 +440,7 @@ local function send_reports_by_smtp(opts, reports, finish_cb)
     }
     for i=cur_batch,next_start-1 do
       local report = reports[i]
-      lua_smtp.sendmail({
+      local send_opts = {
         ev_base = rspamadm_ev_base,
         session = rspamadm_session,
         config = rspamd_config,
@@ -450,7 +450,9 @@ local function send_reports_by_smtp(opts, reports, finish_cb)
         from = report_settings.email,
         recipients = report.rcpts,
         helo = report_settings.helo or 'rspamd.localhost',
-      },
+      }
+
+      lua_smtp.sendmail(send_opts,
           report.message,
           gen_sendmail_cb(report, gen_args))
     end


More information about the Commits mailing list