大网数据广告活动
服务器运维问答

Postfix cannot load Certification Authority data error

· 52CE 我爱测

I'm trying to use postfix as gmail relay smtp parameters are 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 = /et…

问题原文

原帖链接 · AndreaF · CC BY-SA 4.0

I'm trying to use postfix as gmail relay

smtp parameters are

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> 

The message appears as correctly sent but actually no mail is delivered and in the mail log the issue seems caused by an error with 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

The file ca-certificates.crt exists in the path /etc/ssl/ and was already present in Debian distro

Another weird thing is that if in main.cf I try to change the line

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

using some other certificate, the error

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

remains the same, rather than pointing to the name of the certificate configured, despite used postfix reload and systemctl restart postfix.service to make sure to update the configuration

How should I fix this error?

社区高分解答

原帖链接 · Gerald Schneider · CC BY-SA 4.0

On my Debian machines (9, 10 and 11) the path to ca-certificates.crt is:

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

This should be the default, I did not change it.

On my postfix installations I didn't even set the smtp_tls_CAfile parameter. If you installed both postfix and the ca-certificates package via the Debian package management it should default to the correct file.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-12-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。