You want not only a Catch-All configuration like accepting any mail to *@abc.com but also to have a Catch-Anything configuration to accept any mail to *@* ?
This is possible if you have the PCRE support compiled into Postfix. Then you need virtual users in your configuration (see the Posfix documentation) and tweak it as follows:
Make sure that your Postfix is already configured to accept mail for at least one user and one domain. And that this is tested.
This forwards any local part of any domain to the Postfix user [email protected]. Make sure that this is a valid virtual or local user.
In this configuration it seems that Postfix is an Open Relay, but it does not relay for other domains. It accepts mails for any domain and locally delivers the mail to one mailbox.
Sometimes you will then notice a log entry telling you something like "don't list abc.com in mydestination and virtual config". This warning can be ignored as this "strange" setup is not usual.
发布评论
评论(2)
您不仅需要一个 Catch-All 配置(例如接受任何发往 *@abc.com 的邮件),还需要一个 Catch-Anything 配置来接受任何发往 *@* 的邮件?
如果您将 PCRE 支持编译到 Postfix 中,这是可能的。然后,您的配置中需要虚拟用户(请参阅 Posfix 文档)并按如下方式进行调整:
确保您的 Postfix 已配置为接受至少一个用户和一个域的邮件。并且这是经过测试的。
在
main.conf
中设置hash:
部分是从文档中已知的。pcre:
部分是新的。hash:
部分也可以省略。使用以下内容创建文件
virtual_domains.pcre
:<前><代码>/^.*/ 确定
这接受任何域作为有效的收件人域。
使用以下内容创建文件
virtual_forwardings.pcre
:这会将任何域的任何本地部分转发到 Postfix 用户 [电子邮件受保护]。确保这是有效的虚拟或本地用户。
在此配置中,Postfix 似乎是一个开放中继,但它不中继其他域。它接受任何域的邮件并将邮件在本地传送到一个邮箱。
有时您会注意到一个日志条目告诉您“不要在我的目的地和虚拟配置中列出 abc.com”之类的内容。可以忽略此警告,因为这种“奇怪”的设置并不常见。
You want not only a Catch-All configuration like accepting any mail to *@abc.com but also to have a Catch-Anything configuration to accept any mail to *@* ?
This is possible if you have the PCRE support compiled into Postfix. Then you need virtual users in your configuration (see the Posfix documentation) and tweak it as follows:
Make sure that your Postfix is already configured to accept mail for at least one user and one domain. And that this is tested.
In
main.conf
setThe
hash:
parts are the known from the docs. And thepcre:
parts are new.The
hash:
parts can also be omitted.Create the file
virtual_domains.pcre
with the following content:This accepts any domain as valid recipient domain.
Create the file
virtual_forwardings.pcre
with the following content:This forwards any local part of any domain to the Postfix user [email protected]. Make sure that this is a valid virtual or local user.
In this configuration it seems that Postfix is an Open Relay, but it does not relay for other domains. It accepts mails for any domain and locally delivers the mail to one mailbox.
Sometimes you will then notice a log entry telling you something like "don't list abc.com in mydestination and virtual config". This warning can be ignored as this "strange" setup is not usual.
FTR:
另一种方法是将任何邮件发送到“some.local.user”(shell 用户)
中的postfix-pcre 包
必需: main.cf
文件 :/etc/postfix/virtual_alias.pcre
(映射到“some.local.user”的包罗万象)
文件:/etc/postfix/mydestination.pcre(我们接受您向我们扔的任何内容)
FTR:
An alternative way to do it by sending any mail to "some.local.user" (a shell user)
Required: postfix-pcre package
in main.cf
File: /etc/postfix/virtual_alias.pcre
(catchall mapped to "some.local.user")
File: /etc/postfix/mydestination.pcre (we accept whatever you throw at us)