5

I have configured DKIM:

Dec 27 11:10:03 mailer opendkim[378]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim.conf)
Dec 27 11:10:10 mailer postfix/postfix-script[551]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Dec 27 11:10:10 mailer postfix/postfix-script[719]: starting the Postfix mail system
Dec 27 11:10:10 mailer postfix/master[721]: daemon started -- version 3.4.13, configuration /etc/postfix

But the letters are not signed, I connect on port 25, there are no errors, tell me in which configuration file can there be problems? My key is being verified

opendkim-testkey: using default configfile /etc/opendkim.conf
opendkim-testkey: key loaded from /etc/postfix/dkim/mail.private
opendkim-testkey: checking key 'mail._domainkey.domain.com'
opendkim-testkey: key not secure
opendkim-testkey: key OK

Configured exactly as in this guide https://www.linuxbabe.com/mail-server/setting-up-dkim-and-spf

Please tell me which way to look and where I could be wrong with the settings. Thanks in advance to everyone!

grep Socket /etc/opendkim.conf ->

# Socket smtp://localhost
# ##  Socket socketspec
#Socket                  inet:8892@localhost
#Socket    inet:12301@localhost
Socket inet:8891@localhost
#Socket    local:/run/opendkim/opendkim.sock

sammy@mailer:~$ grep -e 8891 -e unix /etc/postfix/main.cf
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891
Oleksandr
  • 161
  • 1
  • 8

1 Answers1

6

It appears you have accidentally missed the section in the tutorial titled "Connect Postfix to OpenDKIM", which configures OpenDKIM on Unix domain sockets instead of the default TCP configuration.

The postfix process is chrooted in /var/spool/postfix, so supporting Unix sockets requires creating a directory for the sockets with appropriate permissions:

sudo mkdir /var/spool/postfix/opendkim
sudo chown opendkim:postfix /var/spool/postfix/opendkim

Change the opendkim configuration to support domain sockets:

sudo nano /etc/opendkim.conf

Change to match:

#Socket inet:8891@localhost
Socket local:/var/spool/postfix/opendkim/opendkim.sock

Edit main.cf to support the configuration:

sudo nano /etc/postfix/main.cf

Change:

smtpd_milters = local:opendkim/opendkim.sock
non_smtpd_milters = $smtpd_milters

Restart both processes:

sudo systemctl restart opendkim postfix
Paul
  • 3,278