不接受Postfix用户名和密码(BadCredentials)



并感谢您的阅读。我知道这个问题已经被问过很多次了——我读过很多不同的答案,并且尝试过其中的大部分。到目前为止,他们都没有工作。我对使用postfix很陌生,非常感谢您能提供的任何帮助。

我在Debian buster上使用Proxmox 6.1。我正在尝试对失败的备份使用电子邮件功能。我的域正在使用Gsuite邮件。我已经用我的ipv4和ipv6公共地址设置了SMTP中继,我已经验证了凭据的正确性,每次更改时都会生成新的.db。

我的sasl_passwd

smtp-relay.gmail.com:587   root@mydomain.com:password

我的main.cf(域和ip已编辑(

# See /usr/share/postfix/main.cf.dist for a commented, more complete version
#myhostname=pve.myisp (auto generated)
myhostname = mydomain.com

#G-Suite relay test
relayhost = smtp-relay.gmail.com:587
# Use tls
smtp_use_tls = yes
smtp_tls_security_level = encrypt
tls_random_source = dev:/dev/urandom
# Use sasl when authenticating to foreign SMTP servers
smtp_sasl_auth_enable = yes
# Path to password map file
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
# List of CAs to trust when verifying server certificate
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
# Eliminates default security options which are imcompatible with gmail
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
compatibility_level = 2

错误日志:

Apr 30 16:45:52 pve postfix/qmgr[34586]: 4B3AD320C9A: from=<root@mydomain.com>, size=396, nrcpt=1 (queue active)
Apr 30 16:45:54 pve postfix/smtp[34617]: 4B3AD320C9A: SASL authentication failed; server smtp-relay.gmail.com[74.125.30.28] said: 535-5.7.8 Username and Password not accepted. Learn more at?535 5.7.8  https://support.google.com/mail/?p=BadCredentials m33sm110720uad.2 - gsmtp
Apr 30 16:45:54 pve postfix/smtp[34617]: 4B3AD320C9A: to=<mypersonalemail@gmail.com>, relay=smtp-relay.gmail.com[2607:f8b0:4003:c0b::1c]:587, delay=2.6, delays=0.05/0.06/2.4/0, dsn=4.7.8, status=deferred (SASL authentication failed; server smtp-relay.gmail.com[2607:f8b0:4003:c0b::1c] said: 535-5.7.8 Username and Password not accepted. Learn more at?535 5.7.8  https://support.google.com/mail/?p=BadCredentials v7sm169048ooo.20 - gsmtp)

我设法解决了我的问题。

忽略任何&所有gsuite文档,并使用[smtp.gmail.com]:587而不是smtp-relay.gmail.com:587

最新更新