我已经配置了安装在 debian 10 中的 postfix 来发送电子邮件,它以前可以正常工作,但突然间就停止了工作,我不知道它为什么停止发送电子邮件,我检查了日志文件,并在 postfix 日志文件中看到了以下内容:
May 8 07:44:20 mail postfix/smtp[32042]: 48D557896B: Server certificate not trusted
May 8 07:44:21 mail postfix/smtp[32042]: certificate verification failed for alt2.gmail-smtp-in.l.google.com[**.***.***.**]:25: untrusted issuer /OU=GlobalSign Root CA - R2/O=GlobalSign/CN=GlobalSign
May 8 07:44:21 mail postfix/smtp[32042]: 48D557896B: to=<*****@gmail.com>, relay=alt2.gmail-smtp-in.l.google.com[**.***.***.**]:25, delay=1.4, delays=0/0/1.4/0, dsn=4.7.5, status=deferred (Server certificate not trusted)
这是我的 etc/postfix/main.cf 文件
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.example.com/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.example.com/privkey.pem
smtp_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.example.com
mydomain = example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#myorigin = /etc/mailname
mydestination = $myhostname, example.com, localhost.com, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_tls_security_level=encrypt
smtp_enforce_tls=yes
请问,为什么我的电子邮件无法发送消息?我该如何解决这个问题?
答案1
看起来您的服务器不信任 GlobalSign 的根 CA 证书。
ca-certificates
您可以尝试先使用以下命令安装最新的软件包来更新您的 ca 证书sudo apt install ca-certificates
然后您可以重新运行update-ca-certificates --fresh
以重建 ca 证书链接。