mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
opendkim: only display last sigerror
This commit is contained in:
@@ -10,7 +10,7 @@ if nsigs == nil then
|
||||
end
|
||||
|
||||
local valid = false
|
||||
local sigerrors = ""
|
||||
local error_msg = "No valid DKIM signature found."
|
||||
for i = 1, nsigs do
|
||||
sig = odkim.get_sighandle(ctx, i - 1)
|
||||
sigres = odkim.sig_result(sig)
|
||||
@@ -23,7 +23,7 @@ for i = 1, nsigs do
|
||||
if sigres == 0 then
|
||||
valid = true
|
||||
else
|
||||
sigerrors = sigerrors .. " " .. tostring(sigres)
|
||||
error_msg = "DKIM signature is invalid, error code " .. tostring(sigres) .. ", search https://github.com/trusteddomainproject/OpenDKIM/blob/master/libopendkim/dkim.h#L108"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,7 +34,7 @@ if valid then
|
||||
odkim.del_header(ctx, "DKIM-Signature", i)
|
||||
end
|
||||
else
|
||||
odkim.set_reply(ctx, "554", "5.7.1", "No valid DKIM signature found. Search https://github.com/trusteddomainproject/OpenDKIM/blob/master/libopendkim/dkim.h#L108 for " .. sigerrors)
|
||||
odkim.set_reply(ctx, "554", "5.7.1", error_msg)
|
||||
odkim.set_result(ctx, SMFIS_REJECT)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user