Setup: Debian 10, postfix 3.4.7 and opendkim 2.11 (both installed from Debian's repositories).
I followed Debian's instructions at https://wiki.debian.org/opendkim
What looks like the culprit is the socket. In /var/log/mail.log
, I do get the error:
Dec 27 ···· postfix/smtpd[1153]: warning: connect to Milter service unix:/var/run/opendkim/opendkim.sock: No such file or directory
Debian's instructions mention this, and they simply say: "double-check permissions".
$ ls -lhd /var/run/opendkim/
drwxr-x--- 2 opendkim opendkim 80 Dec 27 17:20 /var/run/opendkim/
$ sudo ls -lh /var/run/opendkim/
total 4.0K
-rw-rw---- 1 root root 5 Dec 27 17:20 opendkim.pid
srwxrwx--- 1 opendkim opendkim 0 Dec 27 17:20 opendkim.sock
$ groups postfix
postfix : postfix opendkim
Postfix does seem to be running in a chroot (I'm not sure how to tell for certain). I do see a bunch of directories inside /var/spool/postfix
:
$ ls /var/spool/postfix/
active corrupt deferred etc hold lib pid public trace var
bounce defer dev flush incoming maildrop private saved usr
Including /var/spool/postfix/var/run/opendkim
(except that that directory appears empty):
$ ls -lhd /var/spool/postfix/var/run/opendkim/
drwx--x--- 2 opendkim opendkim 4.0K Dec 27 16:25 /var/spool/postfix/var/run/opendkim/
$ sudo ls -lh /var/spool/postfix/var/run/opendkim/
total 0
[EDIT]:
Forgot to add — the relevant sections of the config files are as follows:
Postfix:
smtpd_milters = inet:localhost:2525 unix:/var/run/opendkim/opendkim.sock
non_smtpd_milters = unix:/var/run/opendkim/opendkim.sock
milter_default_action = accept
milter_protocol = 6
(the localhost:2525 is a spam filter that I coded myself. That one seems to be working, as it adds a field to the message's header)
opendkim:
Socket local:/var/run/opendkim/opendkim.sock
[END EDIT]
Can you see something I am missing? Any suggestions on what to try or check?