Postfix - Opendkim - Unable to connect to local socket
Tested on my CentOS6 that postfix seems not really "chrooted".
My setting:
# /etc/opendkim.conf
Socket local:/var/run/opendkim/opendkim.sock
# /etc/postfix/main.cf
smtpd_milters = unix:/var/run/opendkim/opendkim.sock
This will produce: connect to Milter service unix:/var/run/opendkim/opendkim.sock: Permission denied
.
However, the socket umask is 002, result in srwxrwxr-x. opendkim:opendkim opendkim.sock
.
Changing the umask to 000 solves the problem. Still, it's better to have opendkim switch user:group than just open to the world.
Environment:
centos 6.5 2.6.32-573.7.1.el6.x86_64
postfix 2.6.6-6.el6_5 @updates
opendkim 2.10.3-1.el6 @epel
For those that find this and the issue is not resolve with the above answers, my issue was group execute permissions missing on the opendkim socket folder /var/run/opendkim/
I added a cron @reboot to ensure group permissions were set
@reboot root chmod g+x /var/run/opendkim/
Fixes/patches the following warning from returning after a reboot.
warning: connect to Milter service unix:/var/run/opendkim/opendkim.sock: Permission denied
A tcp connection was not a good solution for me as I sign 100k+ emails per hour.