DKIM: Difference between revisions

From DWIKI
(5 intermediate revisions by the same user not shown)
Line 20: Line 20:


= OpenDKIM Howto =
= OpenDKIM Howto =
On Ubuntu you might have to create:
mkdir -p /etc/opendkim/keys
chown -R opendkim.opendkim /etc/opendkim
chmod go-rw /etc/opendkim/keys


Then
  cd /etc/opendkim/keys
  cd /etc/opendkim/keys


Line 27: Line 32:
  opendkim-genkey -s somename -d domain.name
  opendkim-genkey -s somename -d domain.name


Make sure the key ends up in /etc/opendkim/keys and is readable for user opendkim
Make sure the key ends up in /etc/opendkim/keys and is readable for user opendkim, so
chown -R opendkim.opendkim /etc/opendkim/keys


== SigningTable ==
== SigningTable ==
Line 45: Line 51:
  KeyTable        /etc/opendkim/KeyTable
  KeyTable        /etc/opendkim/KeyTable
  SigningTable    refile:/etc/opendkim/SigningTable
  SigningTable    refile:/etc/opendkim/SigningTable


== Postfix ==
== Postfix ==
Line 61: Line 68:
= Checking =
= Checking =


  opendkim-testkey -d domain.name -s selectorname -v -k keys/keyname.private
  opendkim-testkey -d domain.name -s selectorname -vv -k keys/keyname.private


This will try to fetch the key published in DNS, so "record not found" means DNS record not found. No output is good output.
This will try to fetch the key published in DNS, so "record not found" means DNS record not found. No output is good output.
Line 69: Line 76:
==WARNING:Unsafe permissions==
==WARNING:Unsafe permissions==
make readable for user opendkim only
make readable for user opendkim only
==keys do not match==
Try
opendkim-testkey -d domain.name -s selectorname -vv


= FAQ =
= FAQ =
Line 78: Line 90:
  refile:/etc/opendkim/SigningTable
  refile:/etc/opendkim/SigningTable


== opendkim-testkey key not secure ==
 
==opendkim-testkey==
=== opendkim-testkey key not secure ===


Probably means you have no DNSSEC
Probably means you have no DNSSEC


==opendkim-testkey: keys do not match==
===opendkim-testkey: keys do not match===
probably means double check Keytable
probably means double check Keytable
===opendkim-testkey: invalid data set type===
bad dns record?
===opendkim-testkey: multiple DNS replies ===
bad dns record?


== opendkim: /etc/opendkim.conf: /etc/opendkim/keys/default.private: open(): No such file or directory ==
== opendkim: /etc/opendkim.conf: /etc/opendkim/keys/default.private: open(): No such file or directory ==
Line 95: Line 115:
??
??


== opendkim.service: Start request repeated too quickly. ==
Probably rights somewhere, try
opendkim -v


[[Category:Mail]]
[[Category:Mail]]

Revision as of 12:07, 15 August 2022

DomainKeys Identified Mail

Links

 


OpenDKIM Howto

On Ubuntu you might have to create:

mkdir -p /etc/opendkim/keys
chown -R opendkim.opendkim /etc/opendkim
chmod go-rw /etc/opendkim/keys

Then

cd /etc/opendkim/keys

The 'selector' you choose here does not have to be the actual selector used in DNS. It is just the name used for storing the .txt and .private files

opendkim-genkey -s somename -d domain.name

Make sure the key ends up in /etc/opendkim/keys and is readable for user opendkim, so

chown -R opendkim.opendkim /etc/opendkim/keys

SigningTable

  1. somename is the first field in Keytable
*@domain.name somename

KeyTable

Here the name of the selector (the part before ._domainkey) is the one you publish in dns

somename domain.name:selectorname:/path/to/somename.private

Configuration file /etc/opendkim.conf

Mode    s
KeyTable        /etc/opendkim/KeyTable
SigningTable    refile:/etc/opendkim/SigningTable


Postfix

In /etc/postfix/main.cf:

 

milter_protocol = 2
milter_default_action = accept
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891

 

Checking

opendkim-testkey -d domain.name -s selectorname -vv -k keys/keyname.private

This will try to fetch the key published in DNS, so "record not found" means DNS record not found. No output is good output.

WARNING:Unsafe permissions

make readable for user opendkim only


keys do not match

Try

opendkim-testkey -d domain.name -s selectorname -vv

FAQ

opendkim: no signing table match for

In opendkim.conf use:

refile:/etc/opendkim/SigningTable


opendkim-testkey

opendkim-testkey key not secure

Probably means you have no DNSSEC

opendkim-testkey: keys do not match

probably means double check Keytable

opendkim-testkey: invalid data set type

bad dns record?

opendkim-testkey: multiple DNS replies

bad dns record?


opendkim: /etc/opendkim.conf: /etc/opendkim/keys/default.private: open(): No such file or directory

Means it's defined in opendkim.conf, and you're not using KeyTable

 

This doesn't seem to be a valid RSA public key: RSA.xs:178: OpenSSL error: bad base64 decode

??

opendkim.service: Start request repeated too quickly.

Probably rights somewhere, try

opendkim -v