How to mass disable SPF for old users

dzamanakos

Well-Known Member
Feb 15, 2014
61
4
58
cPanel Access Level
Root Administrator
Hi,
in WHM modify account, there is a checkbox "Enable SPF on this account."
I want to disable this function, as i'm using custom spf management and dont want cpanel to modify my txt records.
I've disabled in tweak settings the "Enable SPF on domains for newly created accounts" and i would like to disable it for all the old accounts.

How can i mass change this setting for all accounts?

I see that there is a "HASSPF=1" in /var/cpanel/users/XXX

Will it work if i do something like :

for i in `ls /var/cpanel/users/`
do
sed -i 's/HASSPF=1/HASSPF=0/g' $i
done

or is there any other files that i have to change?

best
 
Last edited by a moderator:

andrew.n

Well-Known Member
Jun 9, 2020
581
158
43
EU
cPanel Access Level
Root Administrator
If you don't tick that when you create a new account it won't be added then. For the old accounts do they also use incorrect SPF settings?