You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like header modification is only allowed before signature check in lua, and then only as a temporary operation not passed on to the target mail daemon:
Note that this only changes the content of the header field used when generating or verifying the signature; the actual delivered message is not modified.
It would be nice if odkim.replace_header(ctx, name, n, newval) and odkim.add_header(ctx, name, value) and odkim.del_header(ctx, name, n) were available in the final script, and in a way where it persists for actual delivery. I understand this is not at all the intended core use for OpenDKIM, but since it already has this great flexible Lua API this would open up the door for doing many rewriting and administrative tasks in a simple Lua script that may otherwise be relatively cumbersome to set up using different postfix submission queues. Especially if the rewrite logic is meant to be relatively complex.
I understand if this is too far out of scope. I just thought the idea would be too useful not to try to suggest it. Thanks so much for working on OpenDKIM, and sorry for taking up your time.
The text was updated successfully, but these errors were encountered:
The code for odkim.replace_header() does not call libmilter API for changing headers, so the description
Note that this only changes the content of the header field used when generating or verifying the signature; the actual delivered message is not modified.
is for it.
On the other hand, LUA funcition odkim.add_header() calls libmilter API smfi_insheader() through the function dkimf_insheader() and odkim.del_header(ctx, name, n) calls libmilter API smfi_chgheader() through the function dkimf_chgheader(). Both of "add_header" and "del_header" is in dkimf_lua_lib_final[], so I think they can be used in a final script (although for del_header(), it might need PR #211, depends on your configuration).
It seems like header modification is only allowed before signature check in lua, and then only as a temporary operation not passed on to the target mail daemon:
It would be nice if
odkim.replace_header(ctx, name, n, newval)
andodkim.add_header(ctx, name, value)
andodkim.del_header(ctx, name, n)
were available in the final script, and in a way where it persists for actual delivery. I understand this is not at all the intended core use for OpenDKIM, but since it already has this great flexible Lua API this would open up the door for doing many rewriting and administrative tasks in a simple Lua script that may otherwise be relatively cumbersome to set up using different postfix submission queues. Especially if the rewrite logic is meant to be relatively complex.I understand if this is too far out of scope. I just thought the idea would be too useful not to try to suggest it. Thanks so much for working on OpenDKIM, and sorry for taking up your time.
The text was updated successfully, but these errors were encountered: