在我的服务器上,我使用这个路由器来实现redirect
virtual_aliases: driver = redirect allow_defer allow_fail data = ${lookup{$local_part@$domain}wildlsearch*@{/etc/vhosts/forwards}} domains = /etc/vhosts/maildomains qualify_preserve_domain retry_use_local_part
和/etc/vhosts/forwards条目一样
[email protected]: [email protected] ^.*@example2.com: [email protected]
这工作正常,并按预期。 现在我的客户要求我将第二行改为“全部转发,除了[email protected]和[email protected]”外,因为这些内容吸引了太多的垃圾邮件。
在/etc/vhosts/forwards有没有一种很好的方法来实现这个逻辑,还是我需要添加另一个黑名单路由器?
您可以有select地在别名文件/ etc / vhosts / forwards中popup电子邮件,或者只是让它消失。 请参阅列表中特殊项目的文档 ,又名别名文件(截至2015年10月14日的项目符号4和5)。
# efficiently and silently discard this email after accepting it [email protected]: :blackhole: # bounce this email. message is optional. [email protected]: :fail: User no longer available # forward the rest [email protected]: [email protected] ^.*@example2.com: [email protected]
只需添加一个条件到路由器:
virtual_aliases: driver = redirect allow_defer allow_fail condition = ${lookup{$local_part@$domain}wildlsearch*@{/etc/vhosts/stoplist}{no}{yes}} data = ${lookup{$local_part@$domain}wildlsearch*@{/etc/vhosts/forwards}} domains = /etc/vhosts/maildomains qualify_preserve_domain retry_use_local_part
如果地址列在/etc/vhosts/stoplist则不会执行redirect。
看起来这是可能的在forwards文件,通过指定没有地址转发到:
[email protected]: [email protected] [email protected]: [email protected]: ^.*@example2.com: [email protected]
这似乎是logging的行为(而不仅仅是一个幸运的实现细节):
如果查找失败,则此示例中展开的string为空。 当数据扩展结果为空string时,路由器会下降。 强制扩展失败也会导致路由器衰减; 其他扩展失败导致递送延期。 资源