mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 04:48:06 +00:00
cmdeploy/opendkim/final.lua: Strip OpenDKIM headers after validation
This commit is contained in:
@@ -28,8 +28,8 @@ for i = 1, nsigs do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if valid then
|
if not valid then
|
||||||
-- Strip all DKIM-Signature headers after successful validation
|
odkim.set_reply(ctx, "554", "5.7.1", "No valid DKIM signature found")
|
||||||
-- Delete in reverse order to avoid index shifting.
|
-- Delete in reverse order to avoid index shifting.
|
||||||
for i = nsigs, 1, -1 do
|
for i = nsigs, 1, -1 do
|
||||||
odkim.del_header(ctx, "DKIM-Signature", i)
|
odkim.del_header(ctx, "DKIM-Signature", i)
|
||||||
@@ -37,6 +37,13 @@ if valid then
|
|||||||
else
|
else
|
||||||
odkim.set_reply(ctx, "554", "5.7.1", error_msg)
|
odkim.set_reply(ctx, "554", "5.7.1", error_msg)
|
||||||
odkim.set_result(ctx, SMFIS_REJECT)
|
odkim.set_result(ctx, SMFIS_REJECT)
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Valid signature found. Strip all DKIM-Signature headers
|
||||||
|
-- Delete in reverse order to avoid index shifting.
|
||||||
|
for i = nsigs, 1, -1 do
|
||||||
|
odkim.del_header(ctx, "DKIM-Signature", i)
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -272,8 +272,8 @@ by OpenDKIM screen policy script before validating the signatures. This
|
|||||||
corresponds to strict :rfc:`DMARC <7489>` alignment (``adkim=s``).
|
corresponds to strict :rfc:`DMARC <7489>` alignment (``adkim=s``).
|
||||||
If there is no valid DKIM signature on the incoming email, the
|
If there is no valid DKIM signature on the incoming email, the
|
||||||
sender receives a “5.7.1 No valid DKIM signature found” error.
|
sender receives a “5.7.1 No valid DKIM signature found” error.
|
||||||
After validating the DKIM signature,
|
After validating the DKIM signature, OpenDKIM strips all ``OpenDKIM:`` headers to
|
||||||
the `final.lua` script strips all ``OpenDKIM:`` headers to reduce message size on disc.
|
reduce message size.
|
||||||
|
|
||||||
Note that chatmail relays
|
Note that chatmail relays
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user