postfix指定有限的中继域,同时允许sasl-auth中继

我试图设置postfix来允许在有限的条件下进行中继:

  • 目标域是预先定义的列表之一
    -要么-
  • 客户端成功login

这里是相关位o'config:

smtpd_sasl_auth_enable=yes relay_domains=example.com smtpd_recipient_restrictions=permit_auth_destination,reject_unauth_destination smtpd_client_restrictions=permit_sasl_authenticated,reject 

问题在于它要求满足这两个限制,而不是两者之一。 也就是说,如果客户端通过身份validation,并且接收者域名是@ example.com,则只允许中继。

相反,如果满足其中一个要求,我需要它来允许中继。 我如何做到这一点,而不诉诸两个不同规则的端口上运行SMTP?

注意:
上下文是共享Web服务器上的出站(仅限于127.0.0.1)MTA,允许所有站点所有者将邮件中继到“拥有”域之一(不是服务器本地),并且允许有限的一组“受信任”站点所有者无限制地中继邮件,只要它们具有有效的SMTPlogin。

当然,在发布这个问题6分钟后,我就知道了。

您可以在您的smtpd_recipient_restrictions设置中放入permit_sasl_authenticated ,并完全删除smtpd_client_restrictions

 smtpd_sasl_auth_enable=yes relay_domains=example.com smtpd_recipient_restrictions=permit_auth_destination, permit_sasl_authenticated,reject_unauth_destination 

在这种情况下, http://www.postfix.org/postconf.5.html#smtpd_recipient_restrictions中未logging此选项的事实certificate是一个无足轻重的沮丧的来源。