配置 Postfix 中继 gmail 但为什么会出现 tatus=deferred (SASL 身份验证失败;无法对服务器 smtp.gmail.com 进行身份验证

配置 Postfix 中继 gmail 但为什么会出现 tatus=deferred (SASL 身份验证失败;无法对服务器 smtp.gmail.com 进行身份验证

故事是这样的,我想使用 POSTFIX 中继主机配置向 gmail 发送邮件。我使用两步验证,更改并仔细检查密码和用户名。sasl_passwd 中一切正常

>postmap -q smtp.gmail.com:587 /etc/postfix/sasl_passwd
Jonh:adfasdfasdfixvl

我真的厌倦了浏览网页却什么也找不到,有什么想法可以解决这个问题吗?!

这是我的配置 main.cf:

后配置-n

    alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = local.domain
myhostname = host.local.domain
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
relayhost = smtp.gmail.com:587
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_type = cyrus
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_use_tls = yes
smtpd_sasl_path = smtpd
unknown_local_recipient_reject_code = 550

以下是失败的日志:

Jan 12 00:19:53 gamma postfix/pickup[11859]: A1EFD800DB: uid=0 from=<root>
Jan 12 00:19:53 gamma postfix/cleanup[11886]: A1EFD800DB: message-id=<[email protected]>
Jan 12 00:19:53 gamma postfix/qmgr[11860]: A1EFD800DB: from=<[email protected]>, size=456, nrcpt=1 (queue active)
Jan 12 00:19:53 gamma postfix/error[11887]: A1EFD800DB: to=<[email protected]>, relay=none, delay=0.02, delays=0.01/0.01/0/0, dsn=4.7.0, status=deferred (delivery temporarily suspended: SASL authentication failed; cannot authenticate to server smtp.gmail.com[173.194.78.109]: no mechanism available)

答案1

检查是否 SAS 连接层二进制文件和库已安装。

尝试安装cyrus-sasl*包:

sudo yum install cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain

相关内容