我正在尝试使用 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>
Run Code Online (Sandbox Code Playgroud)
该消息显示为已正确发送,但实际上没有发送任何邮件,并且在邮件日志中,该问题似乎是由 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
Run Code Online (Sandbox Code Playgroud)
该文件ca-certificates.crt
存在于路径中/etc/ssl/
并且已经存在于 Debian 发行版中
另一个奇怪的事情是,如果main.cf
我尝试改变线路
smtp_tls_CAfile = /etc/ssl/ca-certificates.crt
Run Code Online (Sandbox Code Playgroud)
使用其他一些证书,错误 …