0

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?

2
  • 1
    If the daemon is chrooted you'll find it in master.cf. In that case change /var/run/opendkim/opendkim.sock to /var/spool/postfix/var/run/opendkim/opendkim.sock in OpenDKIM configuration. Dec 27, 2019 at 23:17
  • D'oh!! The Debian documentation actually does say this!!! Not sure why I got confused! That seemed to be the problem. Feel free to write the above (or a rephrased version of the above) as an answer, and I will flag it as the accepted answer.
    – Cal-linux
    Dec 28, 2019 at 0:40

1 Answer 1

1

You practically found the solution yourself: since postfix is chroot'ed, while opendkim isn't, you must put the opendkim's socket inside postfix's chroot:

Socket          local:/var/spool/postfix/var/run/opendkim/opendkim.sock

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .