From a6bd9c893a74310548e51fed691b62db809c3564 Mon Sep 17 00:00:00 2001 From: dzjaivnt <91220882+dzjaivnt@users.noreply.github.com> Date: Thu, 12 Oct 2023 11:39:42 +0200 Subject: Update dmarc.lua Debug logs where broken, so muning functionality not working at all. --- 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 6acf982c3..f80eaad5b 100644 --- a/lualib/plugins/dmarc.lua +++ b/lualib/plugins/dmarc.lua @@ -151,7 +151,7 @@ exports.gen_munging_callback = function(munging_opts, settings) if munging_opts.munge_map_condition then local accepted, trace = munging_opts.munge_map_condition:process(task) if not accepted then - lua_util.debugm(task, 'skip munging, maps condition not satisfied: (%s)', + lua_util.debugm(N, task, 'skip munging, maps condition not satisfied: (%s)', trace) -- Excepted return @@ -170,7 +170,7 @@ exports.gen_munging_callback = function(munging_opts, settings) end if not rcpt_found then - lua_util.debugm(task, 'skip munging, recipients are not in list_map') + lua_util.debugm(N, task, 'skip munging, recipients are not in list_map') -- Excepted return end @@ -178,7 +178,7 @@ exports.gen_munging_callback = function(munging_opts, settings) local from = task:get_from({ 'mime', 'orig' }) if not from or not from[1] then - lua_util.debugm(task, 'skip munging, from is bad') + lua_util.debugm(N, task, 'skip munging, from is bad') -- Excepted return end -- cgit v1.2.3 From 4127a61ee72030c27c80c082283b73b85b3ac5c9 Mon Sep 17 00:00:00 2001 From: dzjaivnt <91220882+dzjaivnt@users.noreply.github.com> Date: Thu, 12 Oct 2023 12:28:48 +0200 Subject: Update dmarc.lua When from.name is Nil its still show up, with != "" not Then you get From: via user Instead of From: otheruser via user 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} --- 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) -- cgit v1.2.3 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: 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', -- cgit v1.2.3