Email Deliverability Repairs in Bulk
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!
-
This worked well for me to catch all the domains on the server: for i in `cat /etc/localdomains`; do whmapi1 validate_current_spfs domain=$i ; done
0 -
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? 0 -
Yes, the validation is read-only. The install option will make changes. 0 -
I have created a case with our documentation team so they can fix the description, which will avoid confusion about this being a read-only operation in the future! 0 -
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? 0 -
Correct. This guy only validates: Validate domain SPF records " cPanel & WHM Developer Portal I don't have an API that will auto-generate an SPF record though like it does in the interface. 0 -
And -just to confirm that too- the Install SPF records script will not correct existing records either then, right? 0 -
Correct - it has to be fed the exact record you want to install. 0 -
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? 0 -
That works well on my end, although I don't have a DNS cluster to easily test that on: [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.0
Please sign in to leave a comment.
Comments
11 comments