Skip to content

Instantly share code, notes, and snippets.

@gwire
Last active April 25, 2023 10:14
Show Gist options
  • Save gwire/b0d306c75fdabda60268f328e2af54cd to your computer and use it in GitHub Desktop.
Save gwire/b0d306c75fdabda60268f328e2af54cd to your computer and use it in GitHub Desktop.
DKIM selectors for exim4 based on From: header
DKIM_DOMAIN = ${extract{domain} {${lookup{${lc:${if def:h_List-Id: {$sender_address_domain}{${domain:${address:$h_From:}}}}}}lsearch*@{CONFDIR/dkim_domains}}}{$value}{}}
DKIM_SELECTOR = ${extract{selector}{${lookup{${lc:${if def:h_List-Id: {$sender_address_domain}{${domain:${address:$h_From:}}}}}}lsearch*@{CONFDIR/dkim_domains}}}{$value}{}}
DKIM_PRIVATE_KEY = ${extract{key} {${lookup{${lc:${if def:h_List-Id: {$sender_address_domain}{${domain:${address:$h_From:}}}}}}lsearch*@{CONFDIR/dkim_domains}}}{$value}{}}
DKIM_CANON = ${extract{canon} {${lookup{${lc:${if def:h_List-Id: {$sender_address_domain}{${domain:${address:$h_From:}}}}}}lsearch*@{CONFDIR/dkim_domains}}}{$value}{relaxed}}
DKIM_STRICT = ${extract{strict} {${lookup{${lc:${if def:h_List-Id: {$sender_address_domain}{${domain:${address:$h_From:}}}}}}lsearch*@{CONFDIR/dkim_domains}}}{$value}{false}}
@gwire
Copy link
Author

gwire commented Jan 18, 2022

/etc/exim4/dkim_domains has a format like the following

example.org: domain=example.org selector=2022 key=/etc/exim4/dkim/dkim_2022.pem

@gwire
Copy link
Author

gwire commented Apr 25, 2023

Updated such that if the server is a list-server, sending out mail with a List-Id: header, the signature is for the envelope sender and not the sender in From:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment