Do you want to have not only a Catch-All configuration, like receiving any mail to *@abc.com, but also a Catch-Anything configuration to receive any mail at * @ *?
This is possible if you have PCRE support compiled in Postfix. Then you will need virtual users in your configuration (see the Posfix documentation) and configure it as follows:
Make sure Postfix is already configured to accept mail for at least one user and one domain. And it is checked.
1) In main.conf install
virtual_alias_domains =
virtual_alias_maps = hash: / etc / postfix / virtual_forwardings, pcre: /etc/postfix/virtual_forwardings.pcre virtual_mailbox_domains = hash: / etc / postfix / virtual_domains, pcre: /etc/postfix/virtual_domains.pcre
Parts of hash: are known from the docs. And pcre: parts pcre: are new. Parts of hash: may also be omitted.
2) Create a virtual_domains.pcre file with the following contents:
/^.*/OK
Accepts any domain as a valid recipient domain.
3) Create a virtual_forwardings.pcre file with the following contents:
/@.*/ someuser@example.com
This forwards any local part of any domain to a Postfix user someuser@example.com. Verify that this is a valid virtual or local user.
In this configuration, Postfix seems to be an open relay, but it is not relayed to other domains. It accepts mail for any domain and locally delivers mail to one mailbox.
Sometimes you may notice a log entry telling you something like "don't list abc.com in mydestination and virtual config". This warning can be ignored because this “weird” setting is not normal.
mailq
source share