Table of content
As a way to fight spam outgoing email are digitally signed, this allow receiver to verify that the message was actually sent from the domain in question and is not forged or modified.
- Requirements: Postfix
- Reference: DKIM wizzard
- Follow-up: SpamAssassin, SPF, grey-listing
Build information
Ensure the following options:
Configuration
The following configuration will allow signing of outgoing mail
for the domain example.com
using the mail
selector
(signing mail for multiple domains will not be detailed here).
On FreeBSD opendkim
run by default as
mailnull
:mailnull
(user/group) so for
the unix socket creation it is necessary to use the directory
/var/run/milteropendkim/
created by the startup script which
has the necessary write permission for that user. It is always
possible to use an inet
socket with an associated IP address
instead.
Signing key
Now the key is generated using the opendkim-genkey
command, this
will create 2 files, one with the private key, and one with a DNS
record containing the public key. Generated files are named according to the
chosen selector (here: main
): mail.private
and main.txt
.
1 |
|
The file main.private
must be moved to the location specified in
the KeyFile
entry of the opendkim.conf
1 |
|
The content of the main.txt
must be place in the DNS domain zone
used for sending our email, this will look as follow:
Integration
Postfix
Now that DKIM is configured, will still need to indicate to our mail server that it needs to sign the outgoing mail, this is done by having our mail server talking to OpenDKIM through the milter protocol
Due to the selected configuration, it is necessary to add the
postfix
user to the mailnull
group to
allow communication with the exported unix socket (umask: 002
):
1 |
|