SPF/PTR Records Configuration

  • Posted on October 20, 2014
  • ChempoAsked by Chempo


I have configured so that people can send me messages through contact form on my site using PostFix on Ubuntu 14.04.

Now every message that I tested ends up in spam. I was informed that I need to setup SPF/PTR Records. I went to DNS section and added new TXT with this: “v=spf1 mx +all”

and I added Gmail MX records.

What now? It still ends up in spam.

Thanks in advance.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I would recommend using the tool at to diagnose how spam filters view your sent messages. Get a temporary email address, send them a copy of the mail that’s being filtered or rejected by the recipient.

I would not recommend using +all in an SPF record, basically this says mail from this domain should be accepted from every mail server on the internet. This basically gives billions of people the authorization to send mail from your domain. The mx part of the spf record does say that mail sent from any server that receives your domain’s mail should be considered valid. ~all or -all are probably better options. -all means the list is exhaustive and mail sent from any host outside the list is a forgery (HardFail) , ~all is a less stringent Soft Fail.

As far as PTR records, most mail servers are going to check that the PTR hostname/domain references back to the ip you’re sending from. If it matches the helo your server sends in the smtp connection that’s also good. Again, will show you a quick view of what checks it does and which are detected as problematic for your setup. This won’t show Yahoo or Gmail’s internal filters, but most filters will look for the same information generally.