changing SPF records

Sandor K

New Member
Hi guys,

I have a directory pickup for delivery server and recently I added a mandrill account for transactional emails only.

When someone adding their domain, they have included in the SPF. This wasn't this way until I added mandrill as a transactional email delivery server.

How can I change the settings/coding so the system will not include in the SPF records.

The Simplest way is to chnage the following code in apps/common/models/SendingDomain.php

Line: return sprintf('%s. IN TXT "v=spf1 mx a ptr %s ~all"', $this->name, implode(" ", $smtpHosts));

Change to : return sprintf('%s. IN TXT "v=spf1 mx a ptr ~all"', $this->name, implode(" ", $smtpHosts));

It will show your desired SPF records to the user. Just make sure to include SPF of Mandrill or any other SMTP service providers SPF in your own domain's SPF records other wise your the emails going out of your system won't get authenticated.

It's best to shorten that spf record even more. The A and PTR records could cause problems in the future if the host in the include file changes their spf record to where it puts your DNS lookup threshold over 10 lookups. You'll get a DKIM temperror if goes past that. It's best to use ip4:/ip6:"IP ADDRESS CIDR" in the place of A, PTR and hostnames if you must include them.