Postfix 無法載入憑證授權單位資料錯誤

Postfix 無法載入憑證授權單位資料錯誤

我正在嘗試使用 postfix 作為 gmail 中繼

smtp參數是

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_use_tls=yes
smtp_tls_CAfile = /etc/ssl/ca-certificates.crt
smtp_tls_key_file=/etc/letsencrypt/live/MYDOMAIN.com/privkey.pem
smtp_tls_cert_file=/etc/letsencrypt/live/MYDOMAIN.com/cert.pem
smtp_tls_security_level=encrypt</id_string></id_string> 

該訊息顯示為已正確發送,但實際上沒有發送任何郵件,並且在郵件日誌中,該問題似乎是由 TSL 錯誤引起的

 cannot load Certification Authority data, CAfile="/etc/ssl/ca-certificates.crt": disabling TLS support
 warning: TLS library problem: error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('/etc/ssl/ca-certificates.crt','r'):
 warning: TLS library problem: error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:76:
 warning: TLS library problem: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib:../crypto/x509/by_file.c:199:
 connect to smtp.gmail.com:25: Network is unreachable

該檔案ca-certificates.crt存在於路徑中/etc/ssl/並且已經存在於 Debian 發行版中

另一個奇怪的事情是,如果main.cf我嘗試改變線路

smtp_tls_CAfile = /etc/ssl/ca-certificates.crt

使用其他一些證書,錯誤

cannot load Certification Authority data, CAfile="/etc/ssl/ca-certificates.crt": disabling TLS support

儘管已使用,但仍保持不變,而不是指向配置的憑證名稱,postfix reloadsystemctl restart postfix.service確保更新配置

我該如何修復這個錯誤?

答案1

在我的 Debian 機器(9、10 和 11)上,路徑ca-certificates.crt是:

/etc/ssl/certs/ca-certificates.crt

這個應該是預設的,我沒有改。

在我的 postfix 安裝中,我甚至沒有設定參數smtp_tls_CAfile。如果您透過 Debian 軟體包管理安裝了 postfix 和 ca-certificates 軟體包,它應該預設為正確的檔案。

答案2

嘗試> chmod 644 ca-certificates.crt 或驗證憑證包的正確佈局

相關內容