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.
(1) When an email is sent, the sender's server:
DKIM-Signature
.
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.
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 |
1. Generate a key pair:
2. Add the TXT record to DNS:
selector1._domainkey.ostrowski.net.pl
v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQE...
3. Configure the mail serverto sign messages using a private key and the selected selector.
v=DKIM1; k=rsa; p=KLUCZ_PUBLICZNY
| Element | Meaning |
|---|---|
| `v` | DKIM version (DKIM1) |
| `k` | Key type (mostly `rsa`) |
| `p` | Public key in Base64 format. |
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
Nazwa: selector1._domainkey.ostrowski.net.pl Typ: TXT Wartość: v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApn...
Once a record has been added, you can test its accuracy:
You can also send an e-mail to:
No. DKIM does not protect:
To obtain full email protection, you need to combine:
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.