Spis treści

Mail: DKIM - DomainKeys Identified Mail

What is DKIM?

DKIM (DomainKeys Identified Mail) is an email authentication mechanism that:

DKIM does not restrict who can send messages - instead it guarantees the integrity and authenticity sender through a cryptographic signature.

How does DKIM work?

(1) When an email is sent, the sender's server:

2. the public key needed for verification is published in the DNS of the domain.

3. the recipient server:

If yes - the message is authorised. If not - considered as potentially fraudulent.

DKIM signature structure

Example of a DKIM header:

DKIM-Signature: v=1; a=rsa-sha256; d=ostrowski.net.pl; s=selector1; c=relaxed/relaxed;
  h=from:to:subject:date;
  bh=fakehash==;
  b=fake_signature_data==
Element Meaning
`v` DKIM version (always `1`)
`a` Cryptographic algorithm
`d` Signing domain
`s` Selector (DNS record name with public key)
`h` List of headers covered by the signature
`b` Proper signature
`bh` Hash of message content

How to configure DKIM?

1. Generate a key pair:

2. Add the TXT record to DNS:

3. Configure the mail serverto sign messages using a private key and the selected selector.

Syntax of the DKIM record in DNS

v=DKIM1; k=rsa; p=KLUCZ_PUBLICZNY
Element Meaning
`v` DKIM version (DKIM1)
`k` Key type (mostly `rsa`)
`p` Public key in Base64 format.

What is a selector?

The selector is a unique name that identifies a given DKIM key. It allows you to:

The selector name is part of the DNS query:

[selector]._domainkey.[domena]

Example:

selector1._domainkey.ostrowski.net.pl

Example of a DKIM record

Nazwa: selector1._domainkey.ostrowski.net.pl  
Typ: TXT  
Wartość: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApn...

DKIM testing

Once a record has been added, you can test its accuracy:

You can also send an e-mail to:

Recommendations for DKIM

Is DKIM enough?

No. DKIM does not protect:

To obtain full email protection, you need to combine:

Common problems with DKIM

Summary

DKIM is an effective method of confirming that an email:

To work effectively:

DKIM is not only protection, but also the foundation of mail credibility in the eyes of Gmail, Outlook and other providers.