mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
opendkim: report DKIM error code in SMTP response
This commit is contained in:
@@ -10,6 +10,7 @@ if nsigs == nil then
|
||||
end
|
||||
|
||||
local valid = false
|
||||
local sigerrors = ""
|
||||
for i = 1, nsigs do
|
||||
sig = odkim.get_sighandle(ctx, i - 1)
|
||||
sigres = odkim.sig_result(sig)
|
||||
@@ -21,6 +22,8 @@ for i = 1, nsigs do
|
||||
-- means the message is acceptable.
|
||||
if sigres == 0 then
|
||||
valid = true
|
||||
else
|
||||
sigerrors = sigerrors .. " " .. tostring(sigres)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -31,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")
|
||||
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_result(ctx, SMFIS_REJECT)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user