Email Deliverability Repairs in Bulk

laxbobber

Member
Jan 4, 2005
19
4
153
cPanel Access Level
Root Administrator
Has anyone run into an easy way to identify accounts needing SPF records (main domains and addon domains). Going into the “Email Deliverability” of each account shows exactly what we need, but a more automated or bulk way would be really helpful. Either locating those in need of repair or bulk repairing would be ideal!
 

laxbobber

Member
Jan 4, 2005
19
4
153
cPanel Access Level
Root Administrator
Thanks @cPRex! I wonder if there's a typo on that documentation. They both say "This function installs a Sender Policy Framework (SPF) record for one or more domains." even though one is named install_spf_records and the other is validate_current_spfs

Is validate_current_spfs a read-only operation?
 
  • Like
Reactions: mtindor

stormy

Well-Known Member
Nov 22, 2003
240
59
178
Spain
cPanel Access Level
Root Administrator
So, just to be clear, the validation script above only checks but doesn't apply any fixes, correct? Which script can we run that does the same as the "repair" button in cPanel's Email Deliverability section?
 

stormy

Well-Known Member
Nov 22, 2003
240
59
178
Spain
cPanel Access Level
Root Administrator
I'm also trying to use this command for my fix:

/usr/local/cpanel/bin/spf_installer USER '+ip4:X.X.X.X' 0 0 1

It should add an extra IP to the spf record, but it won't. We tried this a couple years ago and there was some mention of a bug related to DNS clustering, which we use. Is that so?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,539
2,608
363
cPanel Access Level
Root Administrator
That works well on my end, although I don't have a DNS cluster to easily test that on:

Code:
[root@host /]# grep -i spf /var/named/transfertest.com.db
transfertest.com.    14400    IN    TXT    "v=spf1 +a +mx +ip4:x.x.x.x ~all"

[root@host /]# /usr/local/cpanel/bin/spf_installer transfertest '+ip4:1.2.3.4' 0 0 1

[root@host /]# grep -i spf /var/named/transfertest.com.db
transfertest.com.    14400    IN    TXT    "v=spf1 +a +mx +ip4:x.x.x.x +ip4:1.2.3.4 ~all"
I'm not seeing any obvious cases related to the spf_installer and DNS clusters, but if you can reproduce the problem on a clustered machine we'd like to see it in a ticket for sure.