Compare commits

..

3 Commits

Author SHA1 Message Date
j4n
9ebcd498db fix: opendkim/final.lua: Delete up to 10 Authentication-Results headers
There can be more than one header
2026-01-06 11:08:24 +01:00
j4n
4d0a7001aa opendkim/final.lua: Strip Authentication-Results header 2026-01-05 18:16:34 +01:00
j4n
436f4d0014 opendkim/final.lua: correct header strip iterate
Header indices start from 0
2026-01-05 18:15:49 +01:00
2 changed files with 6 additions and 10 deletions

View File

@@ -31,17 +31,13 @@ end
if valid then
-- Strip all DKIM-Signature headers after successful validation
-- Delete in reverse order to avoid index shifting.
for i = nsigs, 1, -1 do
for i = nsigs - 1, 0, -1 do
odkim.del_header(ctx, "DKIM-Signature", i)
end
-- Delete first and presumably only occurence
odkim.del_header(ctx, "Authentication-Results", 0)
else
odkim.set_reply(ctx, "554", "5.7.1", "No valid DKIM signature found")
-- Delete in reverse order to avoid index shifting.
for i = nsigs, 1, -1 do
odkim.del_header(ctx, "DKIM-Signature", i)
-- Delete up to 10 Authentication-Results headers
for i = 9, 0, -1 do
odkim.del_header(ctx, "Authentication-Results", 0)
end
else
odkim.set_reply(ctx, "554", "5.7.1", error_msg)

View File

@@ -272,8 +272,8 @@ by OpenDKIM screen policy script before validating the signatures. This
corresponds to strict :rfc:`DMARC <7489>` alignment (``adkim=s``).
If there is no valid DKIM signature on the incoming email, the
sender receives a “5.7.1 No valid DKIM signature found” error.
After validating the DKIM signature,
the `final.lua` script strips all ``OpenDKIM:`` headers to reduce message size on disc.
After validating the DKIM signature,
the `final.lua` script strips all ``OpenDKIM:`` headers to reduce message size on disc.
Note that chatmail relays