后缀/ smtpd_relay_restrictions。 如何允许从第三方smtp服务器中继到任何域(但不打开中继!)

默认情况下,我的Postfix允许将中继电子邮件发送到我的域(domain1.com),或者只允许密码auth客户端或“myhostname”地址。 这是大多数邮件服务器的正常情况。

如果我在Exchange Online中设置连接器以通过我的后缀发送出站电子邮件,则客户端(例如Outlook)通常使用Exchange凭据发送电子邮件,并将Exchange服务向前发送电子邮件到我的后缀。

main.cf:

relay_domains = domain1.com ... smtpd_relay_restrictions = reject_non_fqdn_recipient, reject_non_fqdn_sender, reject_unknown_recipient_domain, reject_unknown_sender_domain, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_invalid_hostname, reject_unverified_sender, reject_unknown_client_hostname, reject_unknown_helo_hostname, defer_unauth_destination 

后缀将拒绝“454 4.7.1中继访问被拒绝”代码:

 Anonymous TLS connection established from mail-ve1eur122p0672.outbound.protection.outlook.com[213.199.154.150]: TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits) NOQUEUE: reject: RCPT from mail-ve1eur122p0672.outbound.protection.outlook.com[213.199.154.150]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<EUR03-VE1-obe.outbound.protection.outlook.com> disconnect from mail-ve1eur122p0672.outbound.protection.outlook.com[213.199.154.150] 

这是正常的,因为主机“ve1eur122p0672.outbound.protection.outlook.com”不在myhostname中,而且该主机不使用smtp-auth。

我试过了:

 smtpd_relay_restrictions = reject_non_fqdn_recipient, reject_non_fqdn_sender, reject_unknown_recipient_domain, reject_unknown_sender_domain, permit_mynetworks, permit_sasl_authenticated, check_client_access hash:/etc/postfix/trusted_servers, reject_unauth_destination, reject_invalid_hostname, reject_unverified_sender, reject_unknown_client_hostname, reject_unknown_helo_hostname, defer_unauth_destination 

和:

 # less /etc/postfix/trusted_servers .outbound.protection.outlook.com OK # postmap /etc/postfix/trusted_servers 

但没有结果。

是否有可能允许postfix接受从* .outbound.protection.outlook.com到任何域的邮件,但对于其他人只允许密码validation?

 smtpd_client_restrictions = check_client_access hash:/etc/postfix/trusted_servers 

不是smtpd_relay_restrictions部分。 请阅读: http : //www.postfix.org/postconf.5.html#check_client_access