我只想抓住发送到* @ domain.com和* @ * .domain.com的所有电子邮件到一个唯一的电子邮件[email protected]
@ runlevel6任何想法在虚拟实现正则expression式
cat /etc/postfix/virtual @example.com [email protected] /[@*].example.com$/ [email protected]
我find了:
在main.cf中
virtual_alias_maps = regexp:/var/spool/postfix/plesk/virtual-sub
在虚拟子
/[@.]example\.tld$/ [email protected]
thx runlevel6
Postfix支持使用luser_relayconfiguration选项使用catchall帐户。
有关更多信息,请参阅luser_relay的后缀页面。
当本地(8)递送代理发现邮件收件人不存在时,邮件通常会返回给发件人(“用户未知”)。 有时希望将不存在的收件人的邮件转发到另一台计算机。 为此,您可以使用luser_relayconfiguration参数指定一个替代目标。
如果它不是服务器上的所有域的一个catchall,你可以改为使用虚拟别名。 有关更多信息,请参阅后缀页面以了解虚拟别名 。 该页面的简短描述和代码摘录如下:
使用虚拟别名域,每个托pipe地址都被别名为本地UNIX系统帐户或远程地址。 下面的例子显示了如何在example.com域中使用这个机制。
/etc/postfix/main.cf文件:
virtual_alias_domains = example.com ...other hosted domains... virtual_alias_maps = hash:/etc/postfix/virtual
/等/后缀/虚拟:
[email protected] postmaster [email protected] joe [email protected] jane # Uncomment entry below to implement a catch-all address @example.com jim ...virtual aliases for more domains...
进行这些更改后,运行postmap /etc/postfix/virtual和postfix reload 。
编辑:我认为你正在寻找的正则expression式是/[@.]example\.com$/ system
您可能需要在main.cf中进行其他更改以支持此操作。 看到这个职位了解更多信息。
这里的设置做一个全面的,但对外部服务器(我用这个服务器作为我的智能主机的开发机器)。
postconf -e recipient_canonical_classes=envelope_recipient postconf -e recipient_canonical_maps=regexp:/etc/postfix/recipient_canonical_map postconf -e mynetworks=192.168.0.0/24 postconf -e header_checks=regexp:/etc/postfix/header_checks postconf -e relayhost=mail.example.com
cat / etc / postfix / recipient_canonical_map
/./ [email protected]