How to install/enable SPF records for all accounts on cPanel server – command line option

Let us start with SPF, what is this stands for?

Sender Policy Framework is abbreviated as SPF. This’s an email authentication measure. It’s designed to protect email spoofing by validating emails from a domain with its host’s reputed IP addresses. The authorised hosts details are addedd into the DNS (Domain Name System) of a domain as TXT record.

We already discussed the command to install/enable the SPF record for an account under the WHM server. Please refer this topic for more details, “How to add/enable SPF record for an account – cPanel server command line option

Here I am explaining the method for installing the SPF record for all accounts under your cPanel server. We need username of all accounts to enable the SPF record. We can fetch the user name from the location “/var/cpanel/users”.

Please do follow the steps below to enable the SPF for all accounts on the server.

Step I : Login to server as root.

Step II : Change the directory to “/var/cpanel/users

# cd /var/cpanel/users

Step III : Execute the following;

for i in `ls /var/cpanel/users` ;do /usr/local/cpanel/bin/spf_installer $i ;done

See this to enable SPF and DKIM for all accounts.

That’s it 🙂

Also read;

1, Important cPanel service’s configuration file, path, service name, port – Command line view
2, How to enable Varnish in cPanel server

Arunlal Ashok

DevOps (Server & Cloud infrastructure) Engineer. I'm managing Linux servers since 2012. I started this blog to share and discuss my ideas. Any questions? Write to arun (@)

You may also like...

2 Responses

  1. André says:

    This code dont work more on new versions of cpanel

Leave a Reply

Your email address will not be published. Required fields are marked *