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
set
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
The hash:
parts are the known from the docs. And the pcre:
parts are new.
The hash:
parts can also be omitted.
Create the file virtual_domains.pcre
with the following content:
/^.*/ OK
This accepts any domain as valid recipient domain.
Create the file virtual_forwardings.pcre
with the following content:
/@.*/ [email protected]
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.