Modify automatically generated SPF record

optize

Well-Known Member
Apr 27, 2005
146
0
166
Came across this post from a long time ago:

http://forums.cpanel.net/f5/external-mail-server-spf-207622.html

That file doesn't seem to be used anymore. I'm trying to add a "include:" line automatically into every SPF record that gets generated by cPanel.

Anyone know the proper way to do this? I don't want to do it via custom DNS templates because not everyone wants a SPF record, and I prefer not to grep for existing SPF records in /var/named/ and modify them manually.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

The following file should still be active on your system:

Code:
/usr/local/cpanel/Cpanel/SPF.pm
Could you elaborate on the specific changes you made to this file that did not work?

Thank you.
 

optize

Well-Known Member
Apr 27, 2005
146
0
166
Yep - that's the file.

I've made the following changes to both references to this:

my $mainip = "x.x.x.x";
#my $mainip = Cpanel::NAT::get_public_ip( Cpanel::DIp::getmainserverip() );

There was no impact to generating the SPF, it still used the main system IP.

So, I tried changing $string as well to include an outbound statement.

my $string = "v=spf1 +a +mx +include:eek:utbound.xxxxxx.com +ip4:$mainip";

Again, no changes. I restarted cPanel after making those changes, is there anything else I need to do for this file to work correctly?
 

optize

Well-Known Member
Apr 27, 2005
146
0
166
I've also submitted a support ticket on this, but they told me to submit a feature request, they weren't able to help.

Ticket 4408381