How to enable SPF and DKIM for newly created cPanel accounts

How to enable SPF and DKIM for newly created cPanel accounts

 
It is possible to enable SPF and DKIM for newly created cPanel accounts. You must have server root access to enable SPF and DKIM automatically for all newly created cPanel accounts.

1. Open a new webbrowser and type the below URL to access WHM

https://YourServerIP:2087

OR

http://YourHostname:2086

2. Search for ‘Tweak Settings’ in the WHM search bar on the left
 
tweaksettings-cpanel
 
3. Click on “Tweak Settings” under “Server Configuration”

Home » Server Configuration » Tweak Settings

4. Click on “Domains” tab in tweak settings
 
spf-dkim
 
“Enable DKIM on domains for newly created accounts” will be ‘On’ by default in tweak settings, turn it on if it is ‘Off’ on your server.

“Enable SPF on domains for newly created accounts” will be ‘Off’ by default. Turn this ‘On’ by selecting the radio button

5. Do not forget to save the tweak settings after making the above changes.

Scroll down and you can see the option to save ‘Tweak settings’
 


 

How to enable SPF and DKIM for newly created cPanel accounts from server backend

 
You can do the above steps from the server backend

1. Login to your cPanel server via SSH as ‘root’

2. Take a backup of /var/cpanel/cpanel.config file and edit it

cp -a /var/cpanel/cpanel.config /var/cpanel/cpanel.config.bakk

vi /var/cpanel/cpanel.config

3. Change create_account_spf=0 to create_account_spf=1

Change create_account_dkim=0 to create_account_dkim=1

‘0’ means disabled and ‘1’ means it is enabled

This will enable DKIM and SPF for all newly created cPanel accounts.

root@server [~]# grep -i spf /var/cpanel/cpanel.config
create_account_spf=1

root@server [~]# grep -i dkim /var/cpanel/cpanel.config
create_account_dkim=1