【发布时间】:2018-06-23 12:48:50
【问题描述】:
我正在使用 postfix 通过 gmail 使用应用程序的密码发送电子邮件(已激活两步验证)。
每次我使用 sendmail 命令测试发送邮件时,都会收到此错误:
Action: delayed
Status: 4.7.14
Diagnostic-Code: X-Postfix; delivery temporarily suspended: SASL authentication
failed; server smtp.gmail.com said: 534-5.7.14
<https://accounts.google.com/signin/continue?...> Please log in via your web browser and?534-5.7.14 then try again.?534-5.7.14
这是我的后缀配置:
main.cf
myorigin = /etc/mailname
mydestination = mydomain.com, localhost.fr, localhost
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_tls_security_level = encrypt
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
/etc/postfix/sasl/sasl_passwd:
[smtp.gmail.com]:587 admin@mydomain.com:application_password
这就是我使用 sendmail 的方式:
sendmail -v ...
From: admin@mydomain.com
Subject: Test
This is a test mail
.
有什么想法吗?谢谢!
【问题讨论】:
-
我在使用 smtp.gmail.com 的 posix 配置中也面临身份验证问题。 5 月 7 日 15:59:32 apurb-ThinkPad-E470 postfix/smtp[10589]: 4CC0728214FB: to=
, relay=smtp.gmail.com[64.233.186.109]:587, delay=896, delays=894/0.07/1.7/0, dsn=4.7.8, status=deferred (SASL 身份验证失败;服务器 smtp.gmail.com[64.233.186.109] 说:535-5.7.8 用户名和密码不被接受。了解更多at?535 5.7.8 support.google.com/mail/?p=BadCredentialst7sm9274499qte.74 - gsmtp) 知道如何解决这个问题吗? -
您有没有机会找到解决方案?我遇到了同样的错误,我正在使用我的应用程序专用密码,并且我在我的主帐户上启用了 2FA。
标签: email smtp gmail postfix two-step-verification