
我最近剛第一次安裝了 CentOS 5.5 和 Postfix。
我遵循了 2 個不同的教程,這些教程應該在 SMTP 伺服器上啟用 TLS。兩者都告訴我創建密鑰和證書、編輯配置、透過 telnet 連接來測試伺服器。
一切看起來都應該正常工作。當我使用 telnet 連線時,伺服器通告我可以使用 STARTTLS 進行連線。我已經打開了連接埠 25 和 465 的防火牆。
當我嘗試在 Thunderbird 中啟用 STARTTLS 的情況下發送電子郵件時,出現以下錯誤:
發送郵件時發生錯誤:郵件伺服器發送了不正確的問候語:無法連接到 SMTP 伺服器 192.168.0.9 (192.168.0.9:465),連接錯誤 10061。
按下「確定」後,我收到另一個不太有用的訊息:
訊息發送失敗。無法傳送訊息,因為與 SMTP 伺服器 cinc.centos 的連線在事務過程中遺失。請重試或聯絡您的網路管理員。
我現在一天中最好的時間已經在谷歌上搜尋並擺弄了配置時間。我絕對沒有更接近修復它。我嘗試過谷歌搜尋錯誤訊息,或只是錯誤代碼,但沒有發現任何有用的信息。
然而.. SMTP 伺服器在沒有任何 TLS 加密的情況下運作得很好!因此錯誤肯定只是與加密有關,因此錯誤訊息提到了連接埠 465。
如果有幫助的話,我已經發布了我的 TLS 部分主文件:
smtp_tls_note_starttls_offer = 是
smtpd_tls_received_header = 是
smtpd_sasl_local_domain = cinc.centos
smtpd_sasl_auth_enable = 是
smtpd_sasl_security_options = noanonymousbroken_sasl_auth_clients
= 是 smtpd_recipient_restrictions = Permit_sasl_authenticated ,permit_mynetworks,reject_unauth_destination
smtpd_tls_security_level = 可能
smtpd_tls_key_file = /etc/pki/tls/private/cinc.centos.key
smtpd_tls_cert_file = /etc / pki/tls/certs/cinc.centos.cert
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_timeout = 3600s
smtpd_tls_session_cache_database = btree:/var/spool/postfix/
smtpd_tls_cache_datatls_m
我是如此迷茫透過這整件事!我還沒有接近自己修復它......任何人都可以指出我正確的方向嗎?
太感謝了!
奧利特林德
答案1
使用 openssl 進行偵錯。
openssl s_client -host localhost -starttls smtp
答案2
我在 Thunderbird 連接到 Postfix 時遇到了同樣的問題(Thunderbird 說“ The mail server sent an incorrect greeting: 5.7.1
”)。對我來說,這是透過改變來解決的/etc/postfix/master.cf
,而不是閱讀:
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
..它寫道:
-o smtpd_client_restrictions=permit
-o smtpd_sender_restrictions=permit_sasl_authenticated,reject
-o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
Postfix 在進行身份驗證之前就拒絕了 Thunderbird 的連線。
答案3
您必須新增至 main.cf 中的 mynetworks 條目,以允許您正在測試的 IP 進行連線。如果您嘗試從本機連接,則應配置 mynetworks = localhostIP。 postfix 重新載入和/或 postfix 重新啟動並再次測試。