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 ; doneWe 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 = smtpReplace 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 = 0Run
chattr +ia /etc/exim.conf and restart the Exim.
Thanks