微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

SASL 认证失败;服务器说:530 必须先发出 STARTTLS 命令

如何解决SASL 认证失败;服务器说:530 必须先发出 STARTTLS 命令

我根据本教程使用 Lightsail 和 SES 设置了 postfix:https://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html 当我发送电子邮件时,队列中的电子邮件是这样说的: SASL authentication Failed; server email-smtp.ca-central-1.amazonaws.comhttp://99.79.137.249 said: 530 Must issue a STARTTLS command first
我已尝试更改 smtp_tls_security_level = dane(当前)、smtp_tls_security_level = encryptsmtp_tls_security_level = may 的不同设置,但电子邮件仍然无法发送,尽管状态可能会因不同的设置而改变。 如果需要,我可以提供更详细的日志。
谢谢!

日志

Feb 22 13:51:43 ip-172-26-12-131 postfix/smtpd[936667]: connect from unkNown[45.142.120.6]
Feb 22 13:51:43 ip-172-26-12-131 postfix/smtpd[934814]: warning: unkNown[45.142.120.137]: SASL LOGIN authentication Failed: authentication failure
Feb 22 13:51:43 ip-172-26-12-131 postfix/smtpd[934814]: disconnect from unkNown[45.142.120.137] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Feb 22 13:51:46 ip-172-26-12-131 postfix/smtpd[924010]: warning: unkNown[45.142.120.84]: SASL LOGIN authentication Failed: authentication failure
Feb 22 13:51:46 ip-172-26-12-131 postfix/smtpd[924010]: disconnect from unkNown[45.142.120.84] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Feb 22 13:51:47 ip-172-26-12-131 postfix/pickup[922446]: 0A680BE63C: uid=1000 from=<mail@example.com>
Feb 22 13:51:47 ip-172-26-12-131 postfix/cleanup[939757]: 0A680BE63C: message-id=<20210222185147.0A680BE63C@ip-172-26-12-131.ec2.internal>
Feb 22 13:51:47 ip-172-26-12-131 postfix/qmgr[633056]: 0A680BE63C: from=< mail@example.com >,size=357,nrcpt=1 (queue active)
Feb 22 13:51:47 ip-172-26-12-131 postfix/smtp[939759]: cannot load Certification Authority data,CAfile="/etc/ssl/certs/ca-bundle.crt",CApath="/etc/ssl/certs": disabling TLS support
Feb 22 13:51:47 ip-172-26-12-131 postfix/smtp[939759]: warning: TLS library problem: error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('/etc/ssl/certs/ca-bundle.crt','r'):
Feb 22 13:51:47 ip-172-26-12-131 postfix/smtp[939759]: warning: TLS library problem: error:2006D080:BIO routines:BIO_new_file:no such file:../crypto/bio/bss_file.c:76:
Feb 22 13:51:47 ip-172-26-12-131 postfix/smtp[939759]: warning: TLS library problem: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib:../crypto/x509/by_file.c:199:
Feb 22 13:51:47 ip-172-26-12-131 postfix/smtp[939759]: 0A680BE63C: SASL authentication Failed; server email-smtp.ca-central-1.amazonaws.com[35.183.211.80] said: 530 Must issue a STARTTLS command first
Feb 22 13:51:47 ip-172-26-12-131 postfix/smtp[939759]: 0A680BE63C: to=< mail@example.com>,relay=email-smtp.ca-central-1.amazonaws.com[99.79.137.249]:587,delay=20,delays=20/0.02/0.22/0,dsn=4.0.0,status=deferred (SASL authentication Failed; server email-smtp.ca-central-1.amazonaws.com[99.79.137.249] said: 530 Must issue a STARTTLS command first)
Feb 22 13:51:49 ip-172-26-12-131 postfix/smtpd[936667]: warning: unkNown[45.142.120.6]: SASL LOGIN authentication Failed: authentication failure
Feb 22 13:51:49 ip-172-26-12-131 postfix/smtpd[936667]: disconnect from unkNown[45.142.120.6] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Feb 22 13:51:57 ip-172-26-12-131 postfix/postfix-script[939846]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Feb 22 13:51:57 ip-172-26-12-131 postfix/postfix-script[939973]: warning: /var/spool/postfix/etc/ssl/certs/ssl-cert-snakeoil.pem and /etc/ssl/certs/ssl-cert-snakeoil.pem differ
Feb 22 13:52:05 ip-172-26-12-131 postfix/smtpd[927078]: connect from unkNown[45.142.120.180]
Feb 22 13:52:08 ip-172-26-12-131 postfix/smtpd[927078]: warning: unkNown[45.142.120.180]: SASL LOGIN authentication Failed: authentication failure
Feb 22 13:52:08 ip-172-26-12-131 postfix/smtpd[927078]: disconnect from unkNown[45.142.120.180] ehlo=1 auth=0/1 rset=1 quit=1 commands=3/4
Feb 22 13:52:12 ip-172-26-12-131 postfix/smtpd[936667]: connect from unkNown[45.142.120.15]
Feb 22 13:52:12 ip-172-26-12-131 postfix/smtpd[924703]: connect from unkNown[45.142.120.87]
Feb 22 13:52:18 ip-172-26-12-131 postfix/smtpd[924013]: connect from unkNown[45.142.120.147]

解决方法

根据这条消息:

Feb 22 13:51:47 ip-172-26-12-131 postfix/smtp[939759]: warning: TLS library problem: error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:69:fopen('/etc/ssl/certs/ca-bundle.crt','r'):

我怀疑您使用的是 Ubuntu 服务器,ca-bundle.crt 文件的路径应该是 /etc/ssl/certs/ca-certificates.crt

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。