我有一個 Bluehost 的專用服務器,用于處理多個腳本和專案(特別是 Python)。其中一個包含一個通過 smtp.gmail.com 埠 465 的基本電子郵件發件人,但它隨機停止作業。在挖掘和挖掘之后,我意識到我在該服務器中的用戶沒有成功與 smtp.gmail.com 通信。但事實證明它既沒有與 smtp.live.com 也沒有與 imap.gmail.com 通信,所以我猜那里有問題。
當我執行命令時: openssl s_client -crlf -connect smtp.gmail.com:465 thorugh sudo (或直接來自 root 用戶)并且在服務器中這些是輸出:
CONNECTED(00000003)
depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1
verify return:1
depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
verify return:1
depth=0 CN = imap.gmail.com
verify return:1
---
Certificate chain
0 s:CN = imap.gmail.com
i:C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
1 s:C = US, O = Google Trust Services LLC, CN = GTS CA 1C3
i:C = US, O = Google Trust Services LLC, CN = GTS Root R1
2 s:C = US, O = Google Trust Services LLC, CN = GTS Root R1
i:C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA
---
Server certificate
-----BEGIN CERTIFICATE-----
blablablabla
.
.
.
blablablabla
-----END CERTIFICATE-----
subject=CN = imap.gmail.com
.
.
.
etc
從我的用戶那里:
CONNECTED(00000003)
depth=3 C = GB, ST = Greater Manchester, L = Salford, O = Comodo CA Limited, CN = AAA Certifi cate Services
verify return:1
depth=2 C = GB, ST = Greater Manchester, L = Salford, O = COMODO CA Limited, CN = COMODO RSA Certification Authority
verify return:1
depth=1 C = US, ST = TX, L = Houston, O = "cPanel, Inc.", CN = "cPanel, Inc. Certification Au thority"
verify return:1
depth=0 CN = [My server name!!!!! WHY?????]
verify return:1
---
Certificate chain
0 s:/CN=[my server name]
i:/C=US/ST=TX/L=Houston/O=cPanel, Inc./CN=cPanel, Inc. Certification Authority
1 s:/C=US/ST=TX/L=Houston/O=cPanel, Inc./CN=cPanel, Inc. Certification Authority
i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Certification Au thority
2 s:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO RSA Certification Au thority
i:/C=GB/ST=Greater Manchester/L=Salford/O=Comodo CA Limited/CN=AAA Certificate Services
---
Server certificate
-----BEGIN CERTIFICATE-----
blablablabla
.
.
.
blablablabla
-----END CERTIFICATE-----
subject=CN = [My server again]
.
.
.
etc
Same thing happens with imap.gmail.com, smtp.live.com, and I guess etc. My server seems to be communicating with itself instead external servers. Other openSSL queries to websites through port 443 work perfectly, AND SOMETHING IMPORTANT, when I do Telnet smtp.gmail.com 25, it also gets connected with my own server, not the case with sudo/root user, where it works perfect.
Could I have something broken with SSL or something like that?
Thank you!
uj5u.com熱心網友回復:
對于共享主機,對外部系統的訪問僅限于埠 80 和 443。參考Bluehost Web Hosting 幫助 - 腳本無法建立出站連接:
我們的共享 IP 地址僅允許埠 80(http)、443(https) 上的出站連接。...為了阻止來自我們服務器的垃圾郵件,我們不允許有或沒有專用 IP 的埠 25 和 465 的出站連接。
uj5u.com熱心網友回復:
最好的解決方案是聯系 Bluehost,在擴展到他們的高級團隊后,他們得到了解決方案:
Hello,
Thank you for your response, explaining the issue you are experiencing further.
There is a setting in the WHM that only allows outbound SMTP connections from root, exim and mailman. I set that to off so you will now be able to connect via SMTP as the cPanel user and not just as root.
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/408028.html
標籤:
