To ensure your emails reach the Inbox instead of the Spam folder, you must authenticate your domain using DKIM (DomainKeys Identified Mail) and SPF (Sender Policy Framework).
Part 1: Configuring the Server (Admin)
Note: If you have already configured DKIM globally on your server, skip to Part 2.
By default, DKIM support might not be enabled in Exim. As the server administrator (Root), you need to enable this feature once.
- Log in via SSH as
root. -
Enable DKIM in DirectAdmin config:
cd /usr/local/directadmin ./directadmin set dkim 1 systemctl restart directadmin -
Recompile Exim with DKIM support:
cd /usr/local/directadmin/custombuild ./build update ./build exim ./build exim_conf
Part 2: Enabling DKIM for a Domain (User)
Once the server supports DKIM, you can enable it for specific domains via the control panel.
- Log in to DirectAdmin at User Level.
- Go to E-Mail Manager > E-Mail Accounts.
- Click the button Enable DKIM (usually in the top right).
Success! DirectAdmin has now generated the keys and automatically added the DNS record to your local zone.
Part 3: Configuring SPF
DirectAdmin usually creates a default SPF record for you. However, you can customize it if needed.
- Go to Account Manager > DNS Management.
- Look for a TXT record starting with
v=spf1. - If it's missing, add a new record:
-
Name:
yourdomain.com.(don't forget the trailing dot) - Type: TXT
-
Value:
v=spf1 a mx ip4:123.123.123.123 ~all(Replace IP with your server IP).
-
Name:
Using External DNS?
If you manage your DNS at an external provider (e.g., Cloudflare), enabling DKIM in DirectAdmin does not update the outside world.
You must copy the generated DKIM (TXT) and SPF records from DirectAdmin's "DNS Management" page and paste them into your external DNS provider.
If you manage your DNS at an external provider (e.g., Cloudflare), enabling DKIM in DirectAdmin does not update the outside world.
You must copy the generated DKIM (TXT) and SPF records from DirectAdmin's "DNS Management" page and paste them into your external DNS provider.