我正在使用 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
这是我的后缀配置:
主文件
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
.
有任何想法吗 ?谢谢 !