Cloudflare, reverse DNS and php mail ending up in spam folder

5,745

When you have CloudFlare on, your reverse DNS doesn't match your forward DNS:

$ host 192.73.238.17
17.238.73.192.in-addr.arpa domain name pointer noteafloat.com.

This is one of the many things that get checked to determine if a message may be spam.

This is easy to fix: Just make them match, and use an actual hostname. For instance, set the PTR for 192.73.238.17 to myservername.noteafloat.com (at Ramnode) and set the A record for myservername.noteafloat.com to 192.73.238.17 (at CloudFlare).

Share:
5,745

Related videos on Youtube

Joseph Szymborski
Author by

Joseph Szymborski

Updated on September 18, 2022

Comments

  • Joseph Szymborski
    Joseph Szymborski almost 2 years

    I've been using Cloudflare to host my DNS, and PHPMailer to send e-mail through ZOHOs SMTP servers with great success, but have found that all my e-mails are hitting Gmail, Zoho and Hotmails spam folders.

    When I disabled Cloudflare's DNS hosting, and set-up my reverse DNS server, all my issues were resolved and mail wasn't sent to the spam folder. Also, a host command changed from:

    $ host noteafloat.com
    noteafloat.com has address 108.162.197.82
    noteafloat.com has address 108.162.196.82
    noteafloat.com mail is handled by 10 mx.zohomail.com.
    noteafloat.com mail is handled by 20 mx2.zohomail.com.
    

    to

    $ host noteafloat.com
    noteafloat.com has address 192.73.238.17
    noteafloat.com mail is handled by 20 mx2.zohomail.com.
    noteafloat.com mail is handled by 10 mx.zohomail.com.
    

    Now, while this is all well and good, I rather like the services Cloudflare offers, so I turned it back on after setting up my reverse DNS. When I test the e-mail again, it gets sent to spam, and if I turn Cloudflare off again, it'll work again.

    Am I forced to choose between using Cloudflare and having my mail sent to the spam folder? Please tell me there is a work around!

  • Joseph Szymborski
    Joseph Szymborski about 11 years
    This makes sense, and I've done this, but mail now get sent to my spam folder. must I send mail @myservername.noteafloat.com?
  • Joseph Szymborski
    Joseph Szymborski about 11 years
    by the way, you can check this by doing an rdns on rdns.noteafloat.com
  • Joseph Szymborski
    Joseph Szymborski about 11 years
    ahh, wait a moment, my rdns on 192.73.238.17 is still pointing to noteafloat.com . Thanks so much for your help!
  • Michael Hampton
    Michael Hampton about 11 years
    You'll need some time for the TTL to expire on the reverse DNS. It seemed to be set to 86400 (1 day) for some reason.