域的后缀通配符别名

all*_*llo 4 postfix

有没有办法为域名使用通配符,比如

webmaster@*
Run Code Online (Sandbox Code Playgroud)

域中地址的通配符可用于“@domain”,但“hostmaster@”不起作用。

使用 *@domain 通配符的当前设置:

主要.cf:

virtual_alias_maps = hash:/etc/postfix/virtual
Run Code Online (Sandbox Code Playgroud)

虚拟(用于 的通配符,用于 的domain一个邮件地址domain2):

domain anything
domain2 anything
@domain user@localhost
mail@domain2 user2@localhost
Run Code Online (Sandbox Code Playgroud)

现在我想为每个域都有一些标准地址,比如

webmaster@ user3@localhost
Run Code Online (Sandbox Code Playgroud)

但是这种语法不能以这种方式工作。一种选择是手动将地址添加到每个(非通配符)域,另一种选择可能是使用pcre虚拟表的映射。但是使用 pcre-table 作为别名似乎太不干净了,我想避免手动添加它们。

Håk*_*ist 12

我相信您会想要使用正则表达式类型的映射文件,然后您可以执行类似的操作

/^webmaster@/ user3@localhost

如果您还想保留现有的哈希虚拟文件,我想配置指令将类似于

virtual_alias_maps = hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual-regex