When from.name is Nil its still show up, with != "" not
Then you get
From: via user <user@domain.tld>
Instead of
From: otheruser via user <user@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@domain.tld, [addr] = user@domain.tld}
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)