Posfix:SASL 身份验证失败(unbuntu/office 365)

Posfix:SASL 身份验证失败(unbuntu/office 365)

我无法让 Postfix 与我们的 Office 365 邮件配合使用。

这是 main.cf 文件:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no

readme_directory = no

smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache


smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = signa-01
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = signa.com, signa-01, localhost.localdomain, localhost
relayhost = [smtp.office365.com]:587
mynetworks = 127.0.0.0/
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
smtp_use_tls = yes
smtp_always_send_ehlo = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_security_level = encrypt
smtp_generic_maps = hash:/etc/postfix/generic
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_sasl_mechanism_filter = login

以下是来自 mail.log 的错误:

 Jul 14 11:54:59 signa-01 postfix/error[17234]: DB0D6184D29: to=<[email protected]>, relay=none, delay=0.03, delays=0.02/0/0/0.01, dsn=4.7.3, status=deferred (delivery temporarily suspended: SASL authentication failed; server smtp.office365.com[132.245.25.2] said: 535 5.7.3 Authentication unsuccessful)

我做过的事情:

  • 我用了本教程使用 365 配置 Postfix
  • 我已验证 /sasl_passwd 中的用户名和密码正确
  • 我尝试将 smtp_sasl_mechanism_filter = login 添加到 main.cf

我该如何解决这个问题?

答案1

我已设法弄清楚了这个问题。

Office 365 里面的账户是共享邮件账户,我的客户把账户切换成普通账户后,我们重新配置了 postfix,一切正常。

相关内容