chasquid supports generating DKIM signatures via the hooks mechanism.
The example hook includes integration with driusan/dkim and dkimpy, and assumes the following:
domains/$DOMAIN/dkim_selector
.certs/$DOMAIN/dkim_privkey.pem
.Only authenticated email will be signed.
Install the driusan/dkim tools with something like the following (adjust to your local environment):
for i in dkimsign dkimverify dkimkeygen; do
go get github.com/driusan/dkim/cmd/$i
go install github.com/driusan/dkim/cmd/$i
done
sudo cp ~/go/bin/{dkimsign,dkimverify,dkimkeygen} /usr/local/bin
Generate the domain key for your domain using dkimkeygen
.
dns.txt
(guide).domains/$DOMAIN/dkim_selector
.private.pem
to /etc/chasquid/certs/$DOMAIN/dkim_privkey.pem
.apt install python3-dkim
or the equivalent for your
environment.dknewkey dkim
.dkim.dns
(guide).domains/$DOMAIN/dkim_selector
.dkim.key
to /etc/chasquid/certs/$DOMAIN/dkim_privkey.pem
.Verifying signatures is technically supported as well, and can be done in the same hook. However, it's not recommended for SMTP servers to reject mail on verification failures (source 1, source 2), so it is not included in the example.