We all know how to enable SPF for an account through cPanel. But what if it is to be enabled for mutliple accounts on a server or all accounnts on a server. Logging into cPanel of each user account individually and enabling it is possible but is not practical as it wastes a lot of time (for us and for the clients).
Fortunately there is a command line script provided by cPanel to enable SPF for a domain. Now what if we take the list of accounts of all the accounts on our server and enable SPF via this script in a for loop!! Will it work? Yes it will 🙂
Enter the cPanel server on which to enable SPF for all accounts as root user and issue the below command to enable SPF for all accounts.
If SPF is to be enabled for a selected list of accounts, save the list of cPanel usernames(one entry in each line) in a file (for eg: here I have named the file as filename) and execute the command calling `cat filename` instead of `ls /var/cpanel/users`
Thats it;) You should be good to go now. 😉