Postfix 无法通过远程连接工作

Postfix 无法通过远程连接工作

我正在尝试在运行 Debian Squeeze 的 VPS 上设置电子邮件服务器。我已按照以下说明设置了 Postfix这里

如果我从以下位置连接到服务器,一切似乎都运行正常localhost

mark@revolver:~$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 xxxxx.xxxxxx.com ESMTP Postfix (Debian/GNU)
ehlo localhost
250-xxxxx.xxxxxx.com
250-PIPELINING
250-SIZE 30720000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

此外,相关条目还出现在/var/log/mail.log

May  9 22:03:28 revolver postfix/smtpd[2919]: connect from localhost.localdomain[127.0.0.1]

但是,尝试从我的笔记本电脑远程登录无法正常工作。我可以通过端口 25 连接到主机,但服务器不会响应任何命令,并将在大约 20 秒后关闭连接。例如:

$ telnet xxxx.xxxxxx.com 25
Trying xxx.xxx.xxx.xxx...
Connected to xxxx.xxxxxxx.com.
Escape character is '^]'.
421 Cannot connect to SMTP server xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx:25), connect timeout
Connection closed by foreign host.

有趣的是,日志文件中没有任何内容。

知道是什么原因造成的吗?我对 421 错误特别困惑。为什么服务器尝试自行连接?

答案1

问题归根结底出在防火墙上。端口 25 是开放的,但这些连接被转发到端口 465,这是不允许的。只需在防火墙上添加一个简单功能,问题就解决了:

-A INPUT -p tcp --dport 465 -j ACCEPT

谢谢大家的帮助!

相关内容