PTR record test and spam email validation

PTR record test and spam email validation
Photo by Austin Distel / Unsplash

Recently I faced issue sending emails to Gmail servers using my Cyberpanel. I have been getting error similar to below:

host
gmail-smtp-in.l.google.com[2x04:xxxx:xxxx:c1x::xb] said: 550-5.7.25
[xx01:xx80:xxxxx:xxxxx:xxxx:4ff:xx58:xx68] The IP address sending this
550-5.7.25 message does not have a PTR record setup, or the corresponding
550-5.7.25 forward DNS entry does not point to the sending IP. As a policy,
550-5.7.25 Gmail does not accept messages from IPs with missing PTR
records. 550-5.7.25 Please visit 550-5.7.25
https://support.google.com/mail/answer/81126#ip-practices for more 550
5.7.25 information. 25-20020a631859000000b0051b1b5917f6si28499752pgy.160 -
gsmtp (in reply to end of DATA command)

After looking over resources, I found a tool https://www.mail-tester.com which can easily find missing issues in your email server.

Their detailed overview information helped to detect PTR issues in my mail record. I was using domain.com in PTR record in my Cloud provider network settings (Vultr in this case). Mails were going through mail.domain.com. After changing this record I was able to fix the issues.

Some steps to follow.

  1. Check ipv4 and ipv6 PTR rDNS settings
  2. Use above tool to check spam score of your email
  3. Check hostname of Postfix server

How to check hostname of Postfix server ?

Just write this postconf myhostname in the command line.

Can I change hostname ?

Try to edit sudo nano /etc/postfix/main.cf and restart the server sudo systemctl restart postfix.

Some more reference articles for more details overview: