企业邮箱给谷歌Gmail报错550-5.7.25解决方案

# 企业邮箱给谷歌Gmail报错550-5.7.25解决方案

# 问题表现

今天接到同事报告企业邮箱发送报错的问题,具体问题表现如下:

  1. 我司内部邮箱 xx@XXX.com 邮箱给国内的163和新浪和企业内部发送邮件可以成功
  2. 给Hotmail发送邮件,成功。
  3. 给Gmail发送邮件,报错!

gmail-logo

# 报错退回邮件

This is the mail system at host mail.XXXXX.cn.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
                   The mail system
<XXXXXXXXXXX@gmail.com>: host alt1.gmail-smtp-in.l.google.com[173.194.65.27]
    said: 550-5.7.25 [XXX.XXX.XXX.XXX] The IP address sending this message does
    not have a 550-5.7.25 PTR record setup, or the corresponding forward DNS
    entry does not 550-5.7.25 point to the sending IP. As a policy, Gmail does
    not accept messages 550-5.7.25 from IPs with missing PTR records. For more
    information, go to 550-5.7.25
    https://support.google.com/mail/answer/81126#ip-practices  550-5.7.25 To
    learn more about Gmail's sender policy, go to 550 5.7.25
    https://support.google.com/mail/answer/81126.
    z64-20020a633343000000b005f0a5246e88si5915463pgz.392 - gsmtp (in reply to
    end of DATA command)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

image-20240403151417917

# 查询错误-550 5.7.25的报错

Gmail SMTP 错误和代码 (opens new window)

https://support.google.com/a/answer/3726730?sjid=292064531831216282-NC#5726

0

1.发送此邮件的 IP 地址没有 PTR 记录设置,或者对应的正向 DNS 条目没有指向发件人 IP。根据政策规定,Gmail 不接受从缺少 PTR 记录的 IP 发出的邮件。有关详情,请参阅电子邮件发件人指南。

2.发件人 IP 与指针 (PTR) 记录中指定的主机名的 IP 地址不一致。有关详情,请参阅电子邮件发件人指南。

1
2
3
4

# 什么是PTR 记录

PTR 记录,全称指针记录,是域名系统 (DNS) 中的一种记录类型,它将 IP 地址映射到域名。PTR 记录与 A 记录相反,A 记录将域名映射到 IP 地址。

PTR 记录用于反向 DNS 查找。反向 DNS 查找是一种根据 IP 地址查找域名的过程。这与正向 DNS 查找相反,正向 DNS 查找是根据域名查找 IP 地址。

# 咨询某里云客服

https://help.aliyun.com/zh/dns/reverse-parsing-and-ptr-records

在公共网络上,反向解析是无法由 DNS 服务商提供的,因为IP地址的管理权限属于运营商,所以需要向运营商(ISP)进行申请添加反向解析。如果您的服务器IP是阿里云的,做PTR不收取费用,请您提交工单联系服务器售后服务人员为您添加即可。

# 问问题

公网IP: XXX.XXX.XXX.XXX 
作用自建企业邮箱
1. 我司内部邮箱 xx@XXXX.com邮箱 给国内的163和新浪和企业内部发送邮件可以成功
2. 给Hotmail发送邮件,成功
3. 给Gmail发送邮件,报错!

谷歌Gmail报错:550 5.7.25
1.发送此邮件的 IP 地址没有 PTR 记录设置,或者对应的正向 DNS 条目没有指向发件人 IP。根据政策规定,Gmail 不接受从缺少 PTR 记录的 IP 发出的邮件。
2.发件人 IP 与指针 (PTR) 记录中指定的主机名的 IP 地址不一致。
1
2
3
4
5
6
7
8
9

image-20240403151733364

# 验证问题是否解决

某里云客服添加记录之后

image-20240403152218602

再测试

# yum install bind-utils -y

# nslookup -qa=ptr <IP地址-XXX.XXX.XXX.XXX>
*** Invalid option: qa=ptr
XXX.XXX.XXX.XXX.in-addr.arpa     name = mail.XXXX.cn.
Authoritative answers can be found from:
1
2
3
4
5
6

# 测试邮件

可以发送邮件,但是在收件人的垃圾邮箱里,但至少邮件没有被退回,

问题解决。

image-20240403152321531