commit 4127a61: Update dmarc.lua

GitHub noreply at github.com
Sat Oct 14 08:35:05 UTC 2023


Author: dzjaivnt
Date: 2023-10-12 12:28:48 +0200
URL: https://github.com/rspamd/rspamd/commit/4127a61ee72030c27c80c082283b73b85b3ac5c9

Update dmarc.lua
When from.name is Nil its still show up, with != "" not

Then you get 
From: via user <user at domain.tld>

Instead of 
From: otheruser via user <user at domain.tld>

Debug: 
2023-10-12 12:08:15 #725504(normal) <0b948d>; dmarc; dmarc.lua:191: munging debug: {[user] = user, [domain] = domain.tld, [flags] = {[valid] = true}, [name] = , [raw] = user at domain.tld, [addr] = user at domain.tld}
---
 lualib/plugins/dmarc.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lualib/plugins/dmarc.lua b/lualib/plugins/dmarc.lua
index f80eaad5b..ff33626bf 100644
--- a/lualib/plugins/dmarc.lua
+++ b/lualib/plugins/dmarc.lua
@@ -188,7 +188,7 @@ exports.gen_munging_callback = function(munging_opts, settings)
     local via_addr = rcpt_found.addr
     local via_name
 
-    if from.name then
+    if from.name != "" then
       via_name = string.format('%s via %s', from.name, via_user)
     else
       via_name = string.format('%s via %s', from.user or 'unknown', via_user)


More information about the Commits mailing list