我有一台运行在谷歌计算引擎上的虚拟机(CentOS),一切看起来非常简单,已经阅读了所有我能找到的文档,但是这一件事让我感到不安。我知道出站SMTP连接被GCE阻止,但传入的内容应该不会成为我读过的内容。不过,我已经正确配置服务器(我认为),并通过gcutil添加防火墙支持SMTP,但仍然没有骰子:谷歌计算引擎将不允许传入的SMTP连接
gcutil addfirewall smtp --description="Incoming smtp allowed." --allowed="tcp:smtp"
这增加了该规则,以允许SMTP连接。
gcutil listfirewalls
+------------------------+---------------------------------------+---------+------------+-------------+-------------+
| name | description | network | source-ips | source-tags | target-tags |
+------------------------+---------------------------------------+---------+------------+-------------+-------------+
| default-allow-internal | Internal traffic from default allowed | default | 10.0.0.0/8 | | |
| default-ssh | SSH allowed from anywhere | default | 0.0.0.0/0 | | |
| http2 | Incoming http allowed. | default | 0.0.0.0/0 | | |
| pop3 | Incoming pop3 allowed. | default | 0.0.0.0/0 | | |
| smtp | Incoming smtp allowed. | default | 0.0.0.0/0 | | |
+------------------------+---------------------------------------+---------+------------+-------------+-------------+
列出SMTP规则。其他端口做工精细,我可以进入端口80,22和110,但试图进入端口25时:
telnet nextcore.com 25
Trying 173.255.112.1...
,而不会连接。
连接到虚拟机上的本地主机端口25件作品就好了:
telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 nextcore.localdomain ESMTP Postfix
我缺少什么?
呸,应该检查默认后缀配置。你可以通过我原来的问题看到它是后缀监听,默认情况下,它在GCE上使用CentOS VM,但是我没有看到它被设置为仅监听本地主机。更改main.cf,重新启动后缀,现在它正在拾取外部连接。谢谢! –