How should SPF configured

  • Posted on April 3, 2014
  • canyapanAsked by canyapan

Hi, I have a several domains hosted on my droplet like and and my server’s hostname is like

I have set google services to send and receive emails. But hosted web applications also send emails using those domains (like, and from my droplet.

I have configured following TXT record at DNS for each domains. @ : “v=spf1 ~all”

But I think, this record says that google can send email safely as this domain. So, the e-mails sent from my droplet can still be flagged as spam.

How can I include my droplet as a safe smtp server for all hosted domains?

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 ended up with following configuration. <br> <br>TXT @ “v=spf1 a mx ~all” <br> <br>I also added following record because I send server logs via emails from . <br> <br>TXT server “v=spf1 a ptr -all”

Thank you Doug. This should solve my question…

A useful spf record wizard can be found at <br> <br>Thinking something along the lines of <br>“v=spf1 ~all” <br>or <br>“v=spf1 ip4:your.server.ip.address ~all” <br> <br>