/etc/postfix/header_checks does the trick.
It has to be included to
Add a line like
smtp_header_checks = regexp:/etc/postfix/header_checks
Save and exit the editor.
Now open the file
header_checks and add your regexps.
Use the PREPEND operator to add a custom header to your emails.
The prepended text is output on a separate line, immediately before the input that triggered the PREPEND action.
/^From:/i PREPEND X-DKIM-Options: s=k1; firstname.lastname@example.org
This will add the line
X-DKIM-Options: s=k1; email@example.com
immediately before the line beginning with
Add as many custom headers as you need. There are many more actions than PREPEND as explained in
man 5 header_checks.
Rebuild the database with
service postfix restart
If the postfix header_checks are not working or set twice, then propably
receive_override_options are set incorrect, either in
main.cf or in
grep -R receive_override_options /etc/postfix
Test also with