From 494078bf5904086fba0816e31d02ee6788429808 Mon Sep 17 00:00:00 2001 From: dzjaivnt <91220882+dzjaivnt@users.noreply.github.com> Date: Thu, 12 Oct 2023 12:40:41 +0200 Subject: [PATCH] Update dmarc.lua With name: dmarc; dmarc.lua:191: munging debug: {[domain] = domain.tld [flags] = {[valid] = true, [braced] = true}, [name] = Name [domain.tld], [raw] = , [addr] = user@domain.tld, [user] = user} dmarc; dmarc.lua:234: munged DMARC header for domain.tld: Name [domain.tld] via mark -> user@domain.tld Without name: dmarc; dmarc.lua:191: munging debug: {[domain] = domain.tld [flags] = {[valid] = true, [braced] = true}, [name] = , [raw] = , [addr] = user@domain.tld, [user] = user} dmarc.lua:234: munged DMARC header for domain.tld: user via otheruser -> user@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', -- 2.39.5