Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to Install DKIM and SPF in cPanel  (Read 2790 times)

0 Members and 1 Guest are viewing this topic.

mohitht

  • Guest
How to Install DKIM and SPF in cPanel
« on: January 03, 2014, 10:47:20 pm »
Hi All,

In this post I would like to share how to install DKIM and SPF records in cPanel to avoid spamming.
The following scripts are used to enable DKIM and SPF records

# /usr/local/cpanel/bin/dkim_keys_install <username>

# /usr/local/cpanel/bin/spf_installer      <username>



We can add Domain keys and SPF records for all Cpanel users on your server, execute following command.

for user in `ls -A /var/cpanel/users` ; do

/usr/local/cpanel/bin/dkim_keys_install $user  &&

/usr/local/cpanel/bin/spf_installer $user ; done


We can configure Exim mail server by

edit the main configuration file in
/etc/exim.conf .
and insert the following lines:

DKIM_DOMAIN = ${lc:${domain:$h_from:}}
DKIM_FILE = /var/cpanel/domain_keys/private/${lc:${domain:$h_from:}}
DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}



point the cursor to the line number 1518

it will shows     

remote_smtp:
driver = smtp



Replace the above lines with:

remote_smtp:
driver = smtp
dkim_domain = DKIM_DOMAIN
dkim_selector = default
dkim_private_key = DKIM_PRIVATE_KEY
dkim_canon = relaxed
dkim_strict = 0


Run chattr +ia /etc/exim.conf and restart the Exim.


Thanks  :)


Regards,
Mohith