Link to home
Start Free TrialLog in
Avatar of jnsimex
jnsimex

asked on

spf records

i created an spf record using a wizard but when i test the spf by sending an email to spf-test@openspf.org, i believe the results show that it is not working properly.

"spf-test@openspf.org
mailout02.controlledmail.com #550 5.7.1 <spf-test@openspf.org>: Recipient address rejected: SPF Tests: Mail-From Result="none": Mail From="xxx@simex.ca" HELO name="mail.simex.ca" HELO Result="none" Remote IP="216.191.157.78" ##"

Here is my spf record;
"v=spf1 a mx mx:mail.simex.ca -all"

In the DNS Manager, the zone record type is "TXT" with the subdomain name of "simex.ca"

Please advise.



Avatar of Papertrip
Papertrip
Flag of United States of America image

[root@broken ~]# dig txt simex.ca +short
"mail.simex.ca. 86400 IN TXT v=spf1" "a" "-all"

Open in new window

That is what your TXT record looks like when queried.

It should look like this:
"v=spf1 ip4:216.191.157.78 ~all"

Open in new window


Unless you plan on changing the IP of mail.simex.ca often (probably not), then using the SPF mechanisms "a" and "mx" don't need to be used, all they do is cause another lookup to be performed.  Putting in just the IP of server(s) sending your mail is the best approach.  Also, even if you were to use "a" and/or "mx", you don't have the syntax correct for it in either your example or in the "real" results from my external query.

If you have more than 1 IP you can do either of the following, depending on how many IP's there are (SPF TXT record character limit is 255).

"v=spf1 ip4:216.191.157.78 ip4:1.2.3.4 ip4:5.6.7.8 ~all"

Open in new window

or, if there are too many IP's for 1 record, use CIDR notation
"v=spf1 ip4:216.191.157.78/29 ~all"

Open in new window

Avatar of jnsimex
jnsimex

ASKER

I went with your idea of using a fixed ip in my spf record.

The dns lookup for my TXT record returned "v=spf1 ip4:216.191.157.78 ~all"

I resent the test email and the results are the same.

"spf-test@openspf.org
mailout02.controlledmail.com #550 5.7.1 <spf-test@openspf.org>: Recipient address rejected: SPF Tests: Mail-From Result="none": Mail From="xxx@simex.ca" HELO name="mail.simex.ca" HELO Result="none" Remote IP="216.191.157.78" ##"


ASKER CERTIFIED SOLUTION
Avatar of Papertrip
Papertrip
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jnsimex

ASKER

So I created a PTR record for host name mail.simex.ca

78.157.191.216.IN-ADDR.ARPA

Not sure if this correct but in the text box, it said to enter in the IP address in reverse order + ".IN-ADDR.ARPA"

Yes, it looks much better now.

Thanks for your help.
Avatar of jnsimex

ASKER

Can you explain your logic for using a softfail vs a fail in the SPF?
SPF hardfail will break forwarding 100% of the time.  If you are not concerned with people being able to forward emails from your domain, then you can turn on hardfail.   This is an inherent and well-known problem with SPF.  Keep in mind that it is a common practice for users to setup auto-forwards for their mail, say from their vanity domain to their gmail account for example.

How the receiving server treats SPF softfails is completely up to them.  Also how your mail client interprets results in the headers from authentication checks plays a role.  That is one of the problems in the email world -- you can't dictate how everyone will setup (or break) their receiving servers.  Gmail for example will display a warning that SPF softfailed, and that you should be concerned of a potential spoof.

Basically SPF is far from the end-all for mail authentication, it should be used in conjunction with at least DKIM.  I realize now I should have included that in the earlier replies, not sure why I didn't in hindsight.

How you decide to implement it is completely up to you -- even the big guys do things their own way because they take into consideration things like DKIM signatures, ADSP, receiver policies etc etc... all depends on how you want your mail to be treated.

[root@broken ~]# dig txt _spf.google.com +short
"v=spf1 ip4:216.239.32.0/19 ip4:64.233.160.0/19 ip4:66.249.80.0/20 ip4:72.14.192.0/18 ip4:209.85.128.0/17 ip4:66.102.0.0/20 ip4:74.125.0.0/16 ip4:64.18.0.0/20 ip4:207.126.144.0/20 ip4:173.194.0.0/16 ?all"
[root@broken ~]# dig txt hotmail.com +short
"v=spf1 include:spf-a.hotmail.com include:spf-b.hotmail.com include:spf-c.hotmail.com include:spf-d.hotmail.com ~all"
[root@broken ~]# dig txt paypal.com +short
"v=spf1 include:pp._spf.paypal.com include:3rdparty._spf.paypal.com include:3rdparty1._spf.paypal.com include:3rdparty2._spf.paypal.com include:c._spf.ebay.com ~all"
[root@broken ~]# dig txt facebook.com +short
"v=spf1 ip4:69.63.179.25 ip4:69.63.178.128/25 ip4:69.63.184.0/25 ip4:66.220.144.128/25 ip4:66.220.155.0/24 ip4:69.171.232.128/25 ip4:66.220.157.0/25 ip4:69.171.244.0/24 mx -all"

Open in new window

Avatar of jnsimex

ASKER

Cool man. Thanks for the following up.