Postfix 捕获所有覆盖 virtual_alias_maps 中的所有其他模式

Postfix 捕获所有覆盖 virtual_alias_maps 中的所有其他模式

我认为我已经使用 Postfix 检查了每个带有“catch all”和“overrides catch all”的线程,但仍然无法找到任何解决方案。我有一个传入(仅) smtp 服务器Postfix version 3.5.8。我想使其成为开放中继,我能够使用 来实现它virtual_alias_domains=static:yes/etc/postfix/main.cf然后我想根据收件人域将这些消息发送给几个用户,因此我使用 pcre 创建了一些模式virtual_alias_maps = pcre:/etc/postfix/virtual

/1@test/ test
/2@test/ test2
/@test/ catchallfromtest
/@/ catchall

/etc/postfix/aliases

test: "/var/mail/test.mail"
test2: "/var/mail/test2.mail"
catchallfromtest: "/var/mail/catchallfromtest.mail"
catchall: "/var/mail/catchall.mail"

如果我注释掉  /@/ catchall电子邮件,电子邮件将被正确发送,但如果没有注释掉,每封电子邮件都会发送到 catchall。我尝试了很多方法(不同的顺序,将其拆分为单独的文件,使用不同的数据库类型,对于virtual_alias_map某些用户使用,对于 catchall 使用收件人密件抄送映射,使用luser_relay但它只适用于,$mydomain所以它不适用于我的情况,在模式和行中排除(!//))和使用不同形式的 catchall(,,,//等)。当我尝试使用/.*@.*//^.*@.*&//.+@.+/

postmap -q "1@test" pcre:/etc/postfix/virtual

它返回了正确的别名,但当我尝试发送电子邮件时,它转到 catchall。我还能尝试什么?来自 [documentation][1]

Patterns are applied in the order as specified in the  table,  until  a pattern is found that matches the input string.

因此它应该在第一次模式匹配后就停止,但是它没有。[1]:http://www.postfix.org/pcre_table.5.html

相关内容