我有一个邮件服务器,承载许多虚拟域。
该服务器上的一个虚拟域的所有者要求我阻止来自外部域的邮件到他的邮箱。
我在main.cf有这个设置:
smtpd_sender_restrictions = check_sender_access hash:/etc/postfi/sender_check
这允许我阻止来自域的邮件,但是如果使用此解决scheme,我将阻止来自此发件人域的邮件到服务器中的所有域,而不仅仅是感兴趣的。
我可以在邮箱级别过滤,但是pipe理起来非常麻烦,非常耗时…
你可以在main.cf使用smtpd_restriction_classes这样做:
smtpd_recipient_restrictions = ... check_recipient_access hash:/etc/postfix/recipient_access ... smtpd_restriction_classes = tocustomerx tocustomerx = check_sender_access hash:/etc/postfix/customer_x_sender_access
在/etc/postfix/recipient_access这样的内容:
dom-customer.com tocustomerx
并在/etc/postfix/customer_x_sender_access
dom-xyz.com REJECT
这告诉postfix邮件到您的客户域属于类tocustomerx并且该类应该检查发件人访问/etc/postfix/customer_x_sender_access 。
如果您只想使用Postfix内置filter,那么只有在您可以将不同的公共IP地址分配给后缀服务器时才能完成此操作。
如果是这样,你可以按照这个例子来得到你想要的: Postfix BUILTIN_FILTER_README
或者你可以写一个外部filter,按照Postfix FILTER_README的说明和例子
问候
保罗B.