-
-
Notifications
You must be signed in to change notification settings - Fork 44
Remove DKIM-Signature from incoming mail after checking #747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Check out the page preview at https://staging.chatmail.at/doc/relay/747/ |
4d22f5d to
72a3da4
Compare
72a3da4 to
954bcbe
Compare
| 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 |
There was a problem hiding this comment.
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 :)
hpk42
left a comment
There was a problem hiding this 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>
Refactor DKIM-Header-Pruning into a "if valid-else" construct with a single "return nil" at the end
78b9ebe to
c5e927d
Compare
|
Implemented your feedback. |
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.
The original #533 attempted to remove the header through postfix, but that is too early. Instead, remove the headers in the OpenDKIM
final.luascript after the validation.