MikeL's FreeBSD howto - dkim

[20230913]
pkg install opendkim

/usr/local/etc/mail/opendkim.conf, changes to:
Domain [your domain name] - this must be a comma seperated list of ALL the domains you serve which should have DKIM attached.
Socket local:/var/run/dkim/dkim-milter.sock
KeyFile /var/db/dkim/dkim-private-key
Selector email (using an external tester in 'auto' mode, it found this)

cd /etc
Edit group, add line:
dkim:*:4231:

Edit rc.conf, add:
milteropendkim_enable="YES"

cd /etc/mail
Edit your [systemname].mc
Add line:
INPUT_MAIL_FILTER(`dkim-filter', `S=local:/var/run/dkim/dkim-milter.sock, F=T, T=R:2m')
Add or change line to include dkim:
define(`confINPUT_MAIL_FILTERS', `spamassassin,dkim-filter')
make [systemname]
diff -cw sendmail.cf [systemname].cf
In my case, manually edit [systemname].cf and hack in near "dontblamesendmail":
O UseBlacklist=True
cp [systemname].cf sendmail.cf

cd /var/run
mkdir dkim
chown mailnull dkim
chgrp mailnull dkim
chmod 750 dkim

cd /var/db
mkdir dkim
chown mailnull dkim
chgrp mailnull dkim
Bring in your private key to this dkim dir, named for this example dkim-private-key
chgrp mailnull dkim-private-key
chmod 640 dkim-private-key
service milter-opendkim [start|status|stop]

Errors on startup in:
/var/log/messages
/var/log/maillog

Copyright © 1995-2024 Mike Lempriere (running on host pedicel)