Php

已解決 - Postfix SMTP 埠 Stange 活動

  • November 2, 2020

您好 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

感謝您給我的任何幫助。再見!

PS:在幾週前的 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.

謝謝,我自己解決了這個問題。對於 PHP Mailer,問題在於 cPanel。我必須在 WHM 中允許外部 SMTP 伺服器。

感謝您的幫助。

引用自:https://serverfault.com/questions/1040656