并感谢您的阅读。我知道这个问题已经被问过很多次了——我已经阅读了很多不同的答案,并且尝试了其中的大部分。到目前为止,他们都没有工作过。我对使用 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)