我正在尝试在
Linux机器上设置Postfix服务器以将所有邮件中继到我们的Office365(Exchange,由Microsoft托管)邮件服务器,但是,我一直收到有关发送地址的错误:
BB338140DC1: to= relay=pod51010.outlook.com[157.56.234.118]:587,delay=7.6,delays=0.01/0/2.5/5.1,dsn=5.7.1,status=bounced (host pod51010.outlook.com[157.56.234.118] said: 550 5.7.1 Client does not have permissions to send as this sender (in reply to end of DATA command))
Office 365要求MAIL FROM和From:标头中的发送地址与用于进行身份验证的地址相同.我已经尝试了我在配置中想到的所有内容以使其正常工作.我的postconf -n:
append_dot_mydomain = no biff = no config_directory = /etc/postfix debug_peer_list = 127.0.0.1 inet_interfaces = loopback-only inet_protocols = all mailBox_size_limit = 0 mydestination = xxxxx,localhost.localdomain,localhost myhostname = localhost mynetworks = 127.0.0.0/8 recipient_delimiter = + relay_domains = our.doamin relayhost = [pod51010.outlook.com]:587 sender_canonical_classes = envelope_sender sender_canonical_maps = hash:/etc/postfix/sender_canonical smtp_always_send_ehlo = yes smtp_sasl_auth_enable = yes smtp_sasl_mechanism_filter = login smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = smtp_tls_CAfile = /etc/postfix/cacert.pem smtp_tls_loglevel = 1 smtp_tls_security_level = may smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes
/等/后缀/ sender_canonical:
www-data address@mydomain.com root address@mydomain.com www-data@localhost address@mydomain.com root@localhost address@mydomain.com
此外,sasl_passwd设置为正确的凭据(使用swaks多次测试它们.)身份验证工作,并在from标头正确时发送消息(也使用swaks进行测试,这有效)
电子邮件来自PHP,所以我也试过改变PHP.ini中的sendmail路径,使用通过-f传递正确的地址
因此,出于某种原因,来自www-data和root的邮件没有将from字段重写为Office 365的满意度,并且它不会发送消息.
那里有任何后缀大师可以帮我设置这个中继吗?