commit 494078b: Update dmarc.lua

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


Author: dzjaivnt
Date: 2023-10-12 12:40:41 +0200
URL: https://github.com/rspamd/rspamd/commit/494078bf5904086fba0816e31d02ee6788429808 (refs/pull/4640/head)

Update dmarc.lua
With name:

dmarc; dmarc.lua:191: munging debug: {[domain] = domain.tld [flags] = {[valid] = true, [braced] = true}, [name] = Name [domain.tld], [raw] = <user at domain.tld>, [addr] = user at domain.tld, [user] = user}

dmarc; dmarc.lua:234: munged DMARC header for domain.tld: Name [domain.tld] via mark <otheruser at otherdomain.tld> -> user at domain.tld

Without name:
dmarc; dmarc.lua:191: munging debug: {[domain] = domain.tld [flags] = {[valid] = true, [braced] = true}, [name] = , [raw] = <user at domain.tld>, [addr] = user at domain.tld, [user] = user}

dmarc.lua:234: munged DMARC header for domain.tld: user via otheruser <otheruser at otherdomain.tld> -> user at domain.tld
---
 lualib/plugins/dmarc.lua | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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


More information about the Commits mailing list