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

Let’s start with SPF, what does it stand 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

Post navigation

Arunlal Ashok

Operations Engineer at Endurance International Group. Linux lover. Like to play on Linux console. I started this blog to share and discuss Linux thoughts.

Always happy for an open discussion! Write to arun (@) crybit (dot) com. Check about me for more details. About this blog and our strong members, check The team
Please follow the LinkedIn page

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

Leave a Reply

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