Adding new outgoing mailserver IP to all SPF records

drinky

Member
Aug 14, 2003
11
1
153
CLOUDLINUX 6.8 x86_64 standard WHM 58.0 (build 32)


I've changed my outgoing mail IP address in accordance with How to Configure the Exim Outgoing IP Address - cPanel Knowledge Base - cPanel Documentation

This was due to spamhaus blacklisting an entire block of IPs belonging to my data center.

Everything seems to be working, however, problem now is that sent mail is now getting a "soft fail" message in the header because the new IP isnt listed in each domain's SPF record.

Is there a script to go ahead and add the new IP address to all shared hosting account's SPF record?

TIA
Brett
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello @drinky,

Yes, the following script takes into account the IP address configured in the /etc/mailips file:

Code:
/usr/local/cpanel/bin/spf_installer
Here's a command you could use to update the SPF records for all accounts to the default TXT entry for the new IP address:

Code:
for i in `ls /var/cpanel/users` ;do /usr/local/cpanel/bin/spf_installer $i ;done
Related Documentation: The spf_installer Script - Documentation - cPanel Documentation

Thank you.