Skip to content

Conversation

@j4n
Copy link
Contributor

@j4n j4n commented Dec 3, 2025

The original #533 attempted to remove the header through postfix, but that is too early. Instead, remove the headers in the OpenDKIM final.lua script after the validation.

@j4n j4n marked this pull request as draft December 3, 2025 19:58
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Check out the page preview at https://staging.chatmail.at/doc/relay/747/

@j4n j4n force-pushed the j4n/remove-dkim-header branch from 4d22f5d to 72a3da4 Compare December 3, 2025 19:58
@j4n j4n force-pushed the j4n/remove-dkim-header branch from 72a3da4 to 954bcbe Compare December 3, 2025 20:12
@j4n j4n marked this pull request as ready for review December 3, 2025 20:12
@j4n j4n requested review from hpk42 and link2xt and removed request for hpk42 December 3, 2025 20:12
@j4n j4n self-assigned this Dec 3, 2025
Comment on lines 27 to 37
if not valid then
odkim.set_reply(ctx, "554", "5.7.1", "No valid DKIM signature found")
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
Copy link
Contributor

Choose a reason for hiding this comment

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

this would read clearer to me (i don't know much lua) if it were a "if valid-else" construct and at the end a single "return nil". given there is no automated tests any gain in readability is good :)

Copy link
Contributor

@hpk42 hpk42 left a comment

Choose a reason for hiding this comment

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

looks good to me, just minor nitpicks.
It's missing a changelog.md entry (we still do them with the PR, but soon we want to change to probably git-cliff like chatmail core)

Co-authored-by: holger krekel  <holger@merlinux.eu>
@j4n j4n marked this pull request as draft December 4, 2025 11:13
@j4n j4n marked this pull request as ready for review December 4, 2025 11:14
Refactor DKIM-Header-Pruning into a  "if valid-else" construct with a single "return nil" at the end
@j4n j4n force-pushed the j4n/remove-dkim-header branch from 78b9ebe to c5e927d Compare December 4, 2025 11:22
@j4n j4n merged commit 166bf68 into main Dec 4, 2025
8 checks passed
@j4n j4n deleted the j4n/remove-dkim-header branch December 4, 2025 11:23
@j4n
Copy link
Contributor Author

j4n commented Dec 4, 2025

Implemented your feedback.

missytake pushed a commit that referenced this pull request Dec 6, 2025
The original #533 attempted to remove the header through postfix, but that is too early. Instead, remove the headers in the OpenDKIM `final.lua` script after the validation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants