简体   繁体   English

外发邮件的 Postfix 连接超时 - 端口 25 ***未*** 被 ISP 阻止

[英]Postfix Connection Timeout for Outgoing Mail - Port 25 is ***not*** blocked by ISP

Many similar questions have been asked here, but most have the issue of port 25 being blocked by a cloud provider (ie DigitalOcean) or the ISP (ie Xfinity).这里已经提出了许多类似的问题,但大多数问题是端口 25 被云提供商(即 DigitalOcean)或 ISP(即 Xfinity)阻止。 I have neither of these problems, but still can't send outgoing mail.我没有这些问题,但仍然无法发送外发邮件。

I try to send outgoing mail, but get this error from posfix/smtp我尝试发送外发邮件,但从 posfix/smtp 收到此错误

connect to alt2.gmail-smtp-in.l.google.com[142.250.152.27]:25: Connection timed out

I am running a postfix from a spare laptop that is running Ubuntu Server, so I know it isn't a problem with a cloud provider.我正在从运行 Ubuntu 服务器的备用笔记本电脑上运行后缀,所以我知道这不是云提供商的问题。 Additionally, I have Google Fiber, and they do not block any ports, including port 25. Just as a test, when I telnet to the above address, I can successfully connect.另外,我有谷歌光纤,它们不会阻塞任何端口,包括25端口。作为测试,当我telnet到上述地址时,我可以成功连接。

$ telnet alt2.gmail-smtp-in.l.google.com 25
Trying 2607:f8b0:4001:c56::1a...
Connected to alt2.gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP x17si5369573iow.10 - gsmtp

Any ideas what the final blocker is?任何想法最终的阻止者是什么? The one thing I can think of is my postfix main.cf variables below might need tweaking.我能想到的一件事是我下面的 postfix main.cf 变量可能需要调整。 Also, FYI I am running the postfix server in a Docker container.另外,仅供参考,我在 Docker 容器中运行后缀服务器。

mydestination = localhost.$mydomain, localhost
proxy_interfaces = X.X.X.X # Static IP of Google Fiber router that is externally facing to WAN

After some digging, I looked up my hostname on Realtime Blackhole Lists, or RBLs, and discovered that my hostname and therefore mail server were being rejected as spam by any mail server that checks the public RBLs.经过一番挖掘,我在实时黑洞列表或 RBL 上查找了我的主机名,发现我的主机名和邮件服务器被任何检查公共 RBL 的邮件服务器拒绝为垃圾邮件。

The solution to this was to set up SPF, DKIM, and DMARC through my DNS provider.解决方案是通过我的 DNS 提供程序设置 SPF、DKIM 和 DMARC。 Each of these play a role in reducing hostname spoofing, spam email, and other malicious activites.这些都在减少主机名欺骗、垃圾邮件 email 和其他恶意活动方面发挥作用。 There are many tutorials online on how to do this.网上有很多关于如何做到这一点的教程。

SPF is Sender Policy Framework. SPF 是发件人策略框架。 This is used to prevent others from spoofing your domain.这用于防止其他人欺骗您的域。

DKIM is DomainKeys Identified Mail. DKIM 是域密钥识别邮件。 This allows the senders to authenticate their emails by including a digital signature in the email header.这允许发件人通过在 email header 中包含数字签名来验证他们的电子邮件。 DKIM uses public-key cryptography to verify that an email message was sent from an authorized mail server. DKIM 使用公钥加密来验证 email 消息是从授权的邮件服务器发送的。

DMARC is Domain-based Message Authentication Reporting & Conformance, which builds on SPF and DKIM to prevent domain spoofing. DMARC 是基于域的消息身份验证报告和一致性,它建立在 SPF 和 DKIM 之上以防止域欺骗。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM