2

I'm attempting to configure OpenDKIM with PostFix on CentOS 8.

I've set the following in /etc/opendkim.conf:

PidFile /run/opendkim/opendkim.pid
Mode    sv
Syslog  yes
SyslogSuccess   yes
LogWhy  yes
UserID  opendkim:opendkim
Socket  inet:8891@localhost
Umask   002
SendReports     yes
SoftwareHeader  yes
Canonicalization        relaxed/relaxed
Selector        default
KeyTable        /etc/opendkim/KeyTable
SigningTable    refile:/etc/opendkim/SigningTable
ExternalIgnoreList      refile:/etc/opendkim/TrustedHosts
InternalHosts   refile:/etc/opendkim/TrustedHosts
OversignHeaders From

My /etc/opendkim/KeyTable file is as follow:

mta1._domainkey.esfs.info     esfs.info:mta1:/etc/opendkim/keys/esfs.info/mta1.private

[Edit]

My /etc/opendkim/SigningTable file contains:

*@esfs.info default._domainkey.esfs.info

[/Edit]

My /etc/opendkim/TrustedHosts file is:

127.0.0.1
::1
*.esfs.info

I've generated my domain key with the following command:

sudo opendkim-genkey -b 2048 -d your-domain.com -D /etc/opendkim/keys/your-domain.com -s mta1 -v

I copied the contents of /etc/opendkim/keys/esfs.info/mta1.txt, into my dns entry.

However, when I test the key I get a warning that it's not secure:

$ sudo opendkim-testkey -d esfs.info -s mta1 -vvv
opendkim-testkey: using default configfile /etc/opendkim.conf
opendkim-testkey: checking key 'mta1._domainkey.esfs.info'
opendkim-testkey: key not secure
opendkim-testkey: key OK

When I check the server status, I get the following:

$ sudo systemctl status opendkim
● opendkim.service - DomainKeys Identified Mail (DKIM) Milter
   Loaded: loaded (/usr/lib/systemd/system/opendkim.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2021-02-08 23:15:12 GMT; 5 days ago
     Docs: man:opendkim(8)
           man:opendkim.conf(5)
           man:opendkim-genkey(8)
           man:opendkim-genzone(8)
           man:opendkim-testadsp(8)
           man:opendkim-testkey
           http://www.opendkim.org/docs.html
 Main PID: 80340 (opendkim)
    Tasks: 3 (limit: 4947)
   Memory: 2.8M
   CGroup: /system.slice/opendkim.service
           └─80340 /usr/sbin/opendkim -x /etc/opendkim.conf -P /run/opendkim/opendkim.pid

Feb 14 12:57:17 wp2.lostcarpark.com opendkim[80340]: CA0EC5E150: signing table references unknown key 'default._domainkey.esfs.info'
Feb 14 12:57:17 wp2.lostcarpark.com opendkim[80340]: CB0C55E150: signing table references unknown key 'default._domainkey.esfs.info'
Feb 14 12:57:17 wp2.lostcarpark.com opendkim[80340]: CBF885E150: signing table references unknown key 'default._domainkey.esfs.info'
Feb 14 12:57:17 wp2.lostcarpark.com opendkim[80340]: CCDDA5E150: signing table references unknown key 'default._domainkey.esfs.info'

The following is from /var/log/maillog:

Feb 14 14:52:24 wp2 postfix/pickup[279532]: warning: 374135E150: message has been queued for 1 days
Feb 14 14:52:24 wp2 postfix/pickup[279532]: 374135E150: uid=0 from=<root>
Feb 14 14:52:24 wp2 postfix/cleanup[279857]: 374135E150: message-id=<20210214145224.374135E150@esfs.info>
Feb 14 14:52:24 wp2 opendkim[80340]: 374135E150: signing table references unknown key 'default._domainkey.esfs.info'
Feb 14 14:52:24 wp2 postfix/cleanup[279857]: 374135E150: milter-reject: END-OF-MESSAGE from localhost[127.0.0.1]: 4.7.1 Service unavailable - try again later; from=<root@esfs.info> to=<root@esfs.info>

Hope the above is helpful in disgnosing the problem. Really appreciate if someone can point me in the right direction.

1
  • 1
    Can you also add the content of SigningTable refile:/etc/opendkim/SigningTable ? Feb 14, 2021 at 18:04

1 Answer 1

4

Look at:

dig default._domainkey.esfs.info. txt +short

This returns empty, which is unexpected. Instead you have it under a different name mta1:

dig mta1._domainkey.esfs.info txt +short
"v=DKIM1; k=rsa; " "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzPW/qEl5jIpReXwxZ8WaS07dn3QLwa4/OWFn17bh84SM0ac7jMvo8jbBmotuO0o0oFeoODPFEYUyvXx0TScrkhycRuKqlhraBNOiPiLgRgP9L0/5Z4VdWdAhASgFMfa4mK7lfuZ85dMdyshp/SN9R3zNOvExEtuHNvQ0eUkTBcuY4UneAHhlx5SlRORdSzq02eCsgEskMLzBd7" "tEJargXaRjSLdMLnML8yJVtDHhPBH/G8AJsOWOPoXDyt6vI0pWW1o6A7BEleXYouYlge4w6S2Kgzv+QSBJoLxlCyNDo1kBG2lag5Jos4BjlahIYh1gzI5aDozG5VlVeLAq3B7QMQIDAQAB"
1
  • 2
    Ah, I had default instead of mta1 in /etc/opendkim/SigningTable. Correcting that has fixed it. Feb 14, 2021 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.