你好,ServerFault 社区,
我有一个基于 MySQL 的 Postfix 和 Dovecot 邮件服务器,我遇到了 MySQL 问题,所以我不得不重新安装它,问题就是从那里开始发生。
RoundCube 启动器随机给我(只是偶尔)IMAP 服务器连接错误。有时他说他无法加载电子邮件,因为他无法连接到 IMAP,我必须重新加载页面才能使其再次工作。假设这种情况发生的概率为 50%。
但这不是主要问题,只是使用起来很无聊。
今天我的 SMTP 服务器开始出现奇怪的现象。让我解释一下。
我的 SMTP 和 IMAP 突然停止工作。我可以通过编辑 VPS 的名称服务器来修复 IMAP,它会导致传入邮件的 DNS 解析出现问题。但 SMTP 仍然有一半正常工作。
SMTP 工作原理:
In localhost,
By doing telnet port 25 in localhost,
By doing telnet 587 also from other IPs,
With Apple's Mail Client and not PHP Mail clients. (Ports 25 and 587),
NON-PhP Mailer (I tried with www(.)gmass(.)co/smtp-test) On all the ports (25,465,587).
SMTP 不起作用:
With PHP Mailer (I tried with WHMCS (Main Issue) and www(.)smtper(.)net) ,WHMCS any port SMTPER works on 25,
Telnet to 465 Localhost and non,
Telnet port 25 from external hosts,
By doing telnet port 25 from external hosts (I tryed with Putty).
我确信 99.9999% 不是防火墙问题,因为即使禁用 iPTables,我也会遇到同样的问题。要解决的主要问题是 PHPMailers 无法正常工作,就像 WHMCS 一样。
如您所见,我的 IPTables 端口是开放的,因为我可以将它们与一些 SMTP 客户端一起使用:
Chain INPUT (policy ACCEPT)
target prot opt source destination
f2b-sshd tcp -- anywhere anywhere multiport dports 2233
ACCEPT udp -- anywhere anywhere udp dpt:465
ACCEPT tcp -- anywhere anywhere tcp dpt:urd
ACCEPT tcp -- anywhere anywhere tcp dpt:smtp
f2b-sshd tcp -- anywhere anywhere multiport dports 2233
ACCEPT tcp -- anywhere anywhere tcp dpt:pop3s
ACCEPT tcp -- anywhere anywhere tcp dpt:pop3
f2b-sshd tcp -- anywhere anywhere multiport dports 2233
ACCEPT udp -- anywhere anywhere udp dpt:11334
ACCEPT tcp -- anywhere anywhere tcp dpt:11334
ACCEPT udp -- anywhere anywhere udp dpt:19999
ACCEPT tcp -- anywhere anywhere tcp dpt:19999
ACCEPT tcp -- anywhere anywhere tcp dpt:32400
ACCEPT udp -- anywhere anywhere udp dpt:32400
ACCEPT udp -- anywhere anywhere udp dpt:8888
ACCEPT udp -- anywhere anywhere udp dpt:8096
ACCEPT tcp -- anywhere anywhere tcp dpt:8096
ACCEPT tcp -- anywhere anywhere tcp dpt:8888
ACCEPT udp -- anywhere anywhere udp dpt:50315
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere tcp dpt:webmin
ACCEPT udp -- anywhere anywhere udp dpt:10000
f2b-sshd tcp -- anywhere anywhere multiport dports 2233
ACCEPT udp -- anywhere anywhere udp dpt:10040
ACCEPT udp -- anywhere anywhere udp dpt:10023
ACCEPT udp -- anywhere anywhere udp dpt:11332
ACCEPT udp -- anywhere anywhere udp dpt:mysql
ACCEPT udp -- anywhere anywhere udp dpt:110
ACCEPT udp -- anywhere anywhere udp dpt:100
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:20
ACCEPT udp -- anywhere anywhere udp dpt:993
ACCEPT udp -- anywhere anywhere udp dpt:143
ACCEPT udp -- anywhere anywhere udp dpt:2233
ACCEPT udp -- anywhere anywhere udp dpt:465
ACCEPT udp -- anywhere anywhere udp dpt:587
ACCEPT udp -- anywhere anywhere udp dpt:1988
ACCEPT udp -- anywhere anywhere udp dpt:http-alt
ACCEPT udp -- anywhere anywhere udp dpt:22
ACCEPT udp -- anywhere anywhere udp dpt:25
ACCEPT udp -- anywhere anywhere udp dpt:80
ACCEPT udp -- anywhere anywhere udp dpt:443
ACCEPT udp -- anywhere anywhere udp dpt:2233
ACCEPT tcp -- anywhere anywhere tcp dpt:10040
ACCEPT tcp -- anywhere anywhere tcp dpt:10023
ACCEPT tcp -- anywhere anywhere tcp dpt:11332
ACCEPT tcp -- anywhere anywhere tcp dpt:mysql
ACCEPT tcp -- anywhere anywhere tcp dpt:pop3
ACCEPT tcp -- anywhere anywhere tcp dpt:100
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp-data
ACCEPT tcp -- anywhere anywhere tcp dpt:imaps
ACCEPT tcp -- anywhere anywhere tcp dpt:imap2
ACCEPT tcp -- anywhere anywhere tcp dpt:2233
ACCEPT tcp -- anywhere anywhere tcp dpt:urd
ACCEPT tcp -- anywhere anywhere tcp dpt:submission
ACCEPT tcp -- anywhere anywhere tcp dpt:1988
ACCEPT tcp -- anywhere anywhere tcp dpt:http-alt
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:2233
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
DROP all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
Chain f2b-sshd (4 references)
target prot opt source destination
RETURN all -- anywhere anywhere
RETURN all -- anywhere anywhere
RETURN all -- anywhere anywhere
RETURN all -- anywhere anywhere
感谢您给予我的一切帮助。再见!
附言:在几周前的 MySQL 编辑之前,即使使用基于 PHP 的邮件客户端,一切都运行良好,但我不知道这是邮件主机还是 PHP 主机(WHMCS 和 SMTPER)的问题,因为使用某些网站和 SMTP 客户端,一切运行正常。例如 Apple 的电子邮件。
编辑:我在控制台中也有 Postfix 垃圾邮件:
Oct 30 11:06:07 mail.indst.eu systemd[1]: Starting Postfix Mail Transport Agent...
Oct 30 11:06:07 mail.indst.eu systemd[1]: Started Postfix Mail Transport Agent.
Oct 30 11:06:07 mail.indst.eu systemd[1]: Reloading Postfix Mail Transport Agent.
Oct 30 11:06:07 mail.indst.eu systemd[1]: Reloaded Postfix Mail Transport Agent.
Oct 30 11:06:07 mail.indst.eu systemd[1]: Reloading Postfix Mail Transport Agent.
Oct 30 11:06:07 mail.indst.eu systemd[1]: Reloaded Postfix Mail Transport Agent.
答案1
谢谢,我自己解决了这个问题。对于 PHP Mailer,问题出在 cPanel 上。我必须在 WHM 中允许外部 SMTP 服务器。
感谢您的帮助。