TLS证书过期导致邮件发送失败'certificate verify failed'怎么办?

103 TLS证书过期导致邮件发送失败"certificate verify failed"怎么办?
原因

SMTP 发送时,发件或收件 MTA 尝试 TLS 握手,但证书已过期或被吊销,导致 certificate verify failed 错误。SMTP STARTTLS(RFC 3207)依赖 X.509 证书链来建立加密通道——任何一端证书过期都会导致连接中断。Let's Encrypt 证书有效期仅 90 天,遗忘续签是该问题的最常见原因。

操作步骤

1. 检查证书到期时间
openssl s_client -connect mail.yourdomain.com:25 -starttls smtp 2>/dev/null | openssl x509 -noout -dates → 看 notAfter 日期
2. 续签证书(Let's Encrypt)
certbot renew --force-renewal
或指定域名:certbot certonly --standalone -d mail.yourdomain.com
3. 重启 MTA
systemctl restart postfix(Postfix)/ systemctl restart dovecot(Dovecot)
昆仑邮件系统管理后台 → 系统 → 服务管理 → 重启邮件服务
4. 配置自动续签 cron
0 3 * * * certbot renew --quiet --post-hook "systemctl restart postfix dovecot"

参考:RFC 3207(SMTP STARTTLS)· RFC 5246(TLS 1.2)· Let's Encrypt Certbot 文档