]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Fix some DMARC issues 3387/head
authorJanne Heß <janne@hess.ooo>
Tue, 2 Jun 2020 14:15:14 +0000 (16:15 +0200)
committerJanne Heß <janne@hess.ooo>
Sat, 6 Jun 2020 12:54:34 +0000 (14:54 +0200)
These issues were reported in #2872 which was closed by the stale bot.
This addresses the first two issues by getting rid of the string
"softfail" and by fixing the reason.

src/plugins/lua/dmarc.lua

index 4a68026c245fac2e4c325580acb5d00eae6b1afd..635e6c1d065d98b79e1240545f38facfc064f666 100644 (file)
@@ -218,9 +218,10 @@ local function dmarc_report(task, spf_ok, dkim_ok, disposition,
   local dkim_fail = table.concat(dres.fail or E, '|')
   local dkim_temperror = table.concat(dres.temperror or E, '|')
   local dkim_permerror = table.concat(dres.permerror or E, '|')
+  local disposition_to_return = if disposition == "softfail" then "none" else disposition
   local res = table.concat({
     ip:to_string(), spf_ok, dkim_ok,
-    disposition, (sampled_out and 'sampled_out' or ''), hfromdom,
+    disposition_to_return, (sampled_out and 'sampled_out' or ''), hfromdom,
     dkim_pass, dkim_fail, dkim_temperror, dkim_permerror, spfdom, spf_result}, ',')
 
   return res
@@ -817,7 +818,7 @@ if opts['reporting'] == true then
           }),
         }
         if data.override ~= '' then
-          table.insert(buf, string.format('<reason>%s</reason>', data.override))
+          table.insert(buf, string.format('<reason><type>%s</type></reason>', data.override))
         end
         table.insert(buf, table.concat({
           '</policy_evaluated></row><identifiers><header_from>', data.header_from,