Postfix:所有出站电子邮件上的“连接超时”

APo*_*ott 38 email postfix

我一直在尝试使用 GNU Mailman 设置邮件列表,但这完全是一场灾难,有很多障碍。Postfix 能够接收电子邮件,但根本无法将其发回,我查看了日志,这是我发现的:

Mar 30 16:35:30 apott-server postfix/smtp[22572]: connect to gmail-smtp in.l.google.com[74.125.142.26]:25: Connection timed out
Mar 30 16:36:01 apott-server postfix/smtp[22572]: connect to alt1.gmail-smtp-in.l.google.com[173.194.76.27]:25: Connection timed out
Mar 30 16:36:31 apott-server postfix/smtp[22572]: connect to alt2.gmail-smtp-in.l.google.com[74.125.131.26]:25: Connection timed out
Mar 30 16:37:01 apott-server postfix/smtp[22572]: connect to alt3.gmail-smtp-in.l.google.com[173.194.67.27]:25: Connection timed out
Mar 30 16:37:31 apott-server postfix/smtp[22572]: connect to alt4.gmail-smtp-in.l.google.com[173.194.65.26]:25: Connection timed out
Mar 30 16:37:31 apott-server postfix/smtp[22572]: A0616100CCB: to=<example@gmail.com>, relay=none, delay=150, delays=0.06/0.01/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[173.194.65.26]:25: Connection timed out)
Run Code Online (Sandbox Code Playgroud)

很明显有些东西阻止了外发电子邮件,有人对如何解决这个问题有任何建议吗?

(服务器是一个 Ubuntu Linux 机器)

谢谢你的帮助。

kas*_*erd 29

连接超时意味着您的 TCP SYN 数据包没有收到 SYN-ACK。这意味着某些东西必须阻塞 SYN 或 SYN-ACKS。

您可以使用 traceroute 找出您的 SYN 数据包到达多远

traceroute -n -T -p 25 gmail-smtp-in.l.google.com
Run Code Online (Sandbox Code Playgroud)

请注意,Ubuntu 存在不同的 traceroute 命令。上述命令适用于 traceroute.db,但不适用于 traceroute-nanog 或 inetutils-traceroute。

使用端口 80 而不是端口 25 运行第二个跟踪路由进行比较可能很有用。

  • 对于发现此问题但在 AWS EC2 上的任何人:传出 SMTP [有意限制速率](https://forums.cpanel.net/threads/intermittent-exim-gmail-smtp-connection-timeout.523911/),但您可以[要求放松](https://aws.amazon.com/forms/ec2-email-limit-rdns-request)。 (9认同)
  • 该输出表明 SYN 数据包没有使其超出您自己的网络。SYN 数据包被 192.168.1.254 或路径上的下一个路由器阻止。您可以使用端口 80 将输出与另一个进行比较。 (4认同)
  • 谢谢你的回答。输出如下:traceroute to gmail-smtp-in.l.google.com (74.125.142.27), 30 hopsmax, 60 byte packet 1 192.168.1.254 3.567 ms 20.770 ms * 4 * 4 * 2 * 2 * * 5 * * * 6 * * * 7 * * * 8 * * * 9 * * * 10 * * * 11 * * * 12 * * * 13 * * * 14 * * * 15 * * * 16 * * * 17 * * * 18 * * * 19 * * * 20 * * * 21 * * * 22 * * * 23 * * * 24 * * * 25 * * * 26 * * * 27 * * * 28 * * * 29 * * * 30 * * * (2认同)

小智 8

这可能是无关的,但我要在这里发布它,因为我很难找到我的问题的答案。通过编辑 my/etc/resolv.conf以使用 Google 的名称服务器而不是它设置为的 10.0.xx IP,我能够从一个 vagrant virtual box 获取出站电子邮件:

sudo vi /etc/resolv.conf
Run Code Online (Sandbox Code Playgroud)

更改名称服务器 IP:

nameserver 8.8.8.8
Run Code Online (Sandbox Code Playgroud)

然后你需要重新启动postfix:

sudo /etc/init.d/postfix restart
Run Code Online (Sandbox Code Playgroud)

  • 不是我要接受的问题。 (2认同)