DKIM with Exim and Direct Admin

Pigeon - Email - Server

You run your own server, for a few clients or just for yourself. If mail is sent from that server (you don’t use a relay server) chances are that mail delivery isn’t optimal. Especially to GMail and Outlook/Hotmail addresses.

Assumption: Your spf record is fine, including ipv6

Now you need a DKIM record in your DNS and your server to sign it.

Install DKIM

Go here, follow the steps:

https://help.directadmin.com/item.php?id=569

If you use, like me, external DNS servers, you need to add that TXT record manually.

./directadmin c | grep dkim

Will give

dkim=1
dkim_selector=x

So now
– DKIM is on
– The selector is x

Generate DKIM for a domain

List all your domains

cd /etc/virtual

Generate keys

/usr/local/directadmin/scripts/dkim_create.sh domain.com

You can check it by

cd domain.com
ls

And you will see dkim.private.key and dkim.public.key
The public key is the one you want to add to your DNS.
The easiest way to do that is to go to Direct Admin -> Admin Tools -> DNS Administration
Click on your domain and look for TXT entry x._domainkey. Copy that entry over to your external DNS servers.

You can also (while still in domain.com directory)

nano dkim.public.key

or

vim dkim.public.key

The key is between -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY-----

Copy that key and prefix it with v=DKIM1; k=rsa; p=

Check it

Go to the link below and fill in your domain name and the selector (x)

https://www.mail-tester.com/spf-dkim-check

Leave a Reply

Your email address will not be published.