I installed postfix on an Ubuntu 16.04 LTS server and tested the default settings. I was able to send a test email successfully. Then I wanted to add dkim, which is where I started running into a problem. My emails don't seem to be getting signed.
When I run
opendkim-testkey -d mydomain.com -s mail -vvv
I get
opendkim-testkey: /etc/postfix/dkim.key: open(): Permission denied
Ownership and permissions for /etc/postfix/dkim.key
-rw------- 1 opendkim opendkim 887 Sep 7 16:07 dkim.key
Postfix is also a part of the opendkim group
postfix : postfix opendkim
I hope someone has an idea, because I'm here scratching my head on this one.
So, the problem was in /etc/opendkim.conf
I forgot to uncomment and edit some lines:
These were originally all commented out. I had previously purged and reinstalled opendkim and forgot this step.
Hopefully this will give someone else some help when they have a brain fart like me! ;-)