You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04上Postfix无法发送邮件:本地域名回环及SMTP连接超时问题求助

Ubuntu 22.04上Postfix无法发送邮件:本地域名回环及SMTP连接超时问题求助

我在Ubuntu 22.04上部署了Postfix邮件服务,目前只能接收邮件,完全发不出去。我是按照官方的安装配置教程一步步操作的,但发送功能始终失效。我用sudo tail -f /var/log/mail.log查看了邮件日志,发现了两类关键错误,麻烦大家帮我分析下问题出在哪。

日志内容

Dec 31 11:26:01 example postfix/smtp[9961]: 58A39D25A: to=<opendkim@example.com>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for example.com loops back to myself)

Dec 31 11:26:01 example postfix/smtp[8787]: 58103D252: to=<vmail@example.com>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for example.com loops back to myself)

Dec 31 11:26:01 example postfix/smtp[9593]: 576CAD23A: to=<root@example.com>, relay=none, delay=0.02, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for example.com loops back to myself)

Dec 31 11:26:01 example postfix/qmgr[5301]: 58A39D25A: removed

Dec 31 11:26:01 example postfix/qmgr[5301]: 58103D252: removed

Dec 31 11:26:01 example postfix/qmgr[5301]: 576CAD23A: removed

Dec 31 11:26:25 example postfix/smtp[7272]: connect to alt1.gmail-smtp-in.l.google.com[142.250.150.26]:25: Connection timed out

Dec 31 11:26:44 example postfix/pickup[9439]: 69CE6D23E: uid=1001 from=<founder@example.com>

Dec 31 11:26:44 example postfix/cleanup[8226]: 69CE6D23E: message-id=<20231231112644.pRsVV%founder@example.com>

Dec 31 11:26:44 example postfix/qmgr[5301]: 69CE6D23E: from=<founder@example.com>, size=335, nrcpt=1 (queue active)

Dec 31 11:26:55 example postfix/smtp[7272]: connect to alt2.gmail-smtp-in.l.google.com[2404:6800:4003:c00::1b]:25: Connection timed out

Dec 31 11:26:55 example postfix/smtp[7272]: D1398D22E: to=<examplez@gmail.com>, orig_to=<root>, relay=none, delay=4374, delays=4223/0/150/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2404:6800:4003:c00::1b]:25: Connection timed out)

我观察到的两个核心问题

  • 本地域名回环错误:给example.com域名下的本地用户(比如root、vmail)发邮件时,提示mail for example.com loops back to myself,邮件直接退回
  • 外部SMTP连接超时:给外部邮箱(比如gmail)发邮件时,连接对方SMTP服务器的25端口超时,邮件一直处于延迟投递状态

我自己瞎琢磨了下,本地回环可能和Postfix的mydestination或者DNS解析配置有关?连接超时会不会是ISP封了25端口,或者我服务器的防火墙没开出站25端口?但不确定具体该怎么排查和调整,有没有过来人给点具体的建议呀?

备注:内容来源于stack exchange,提问作者Mohammed Baashar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.20 13:33:01