Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmdeploy/src/cmdeploy/opendkim/final.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there can be multiple Authentication-Results headers IIRC see https://datatracker.ietf.org/doc/html/rfc7601#appendix-B.5

It's best to remove all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no mechanism to count these, as opposed to the DKIM headers; so the last commit just tries to delete up to 10 headers.

else
odkim.set_reply(ctx, "554", "5.7.1", error_msg)
odkim.set_result(ctx, SMFIS_REJECT)
Expand Down
Loading