I'd like to configure Postfix (on Ubuntu) to catch all email for all domain and store them locally.
I'd use it for testing. The application under test sends emails to random addresses (abc@abc.com, def@other.tv, and so on), and I'd like to check these emails locally (thunderbird).
I already now that the following in main.cf forwards anyuser@mydestination to localuser:
local_recipient_maps=
luser_relay = localuser
But I'd like to forward anyuser@anydomain to localuser too.
What is the simplest Postfix configuration for this?
Thank you!
Best Answer
This is a good start! While there might be other ways, I'll continue from where you have started, i.e.
In this sitation you only need to make all domais handled as if they were in
$mydestination
.Overriding Postfix's built-in default
transport:nexthop
selection is possible by using transport maps:In your
main.cf
, addtransport_maps = hash:/etc/postfix/transport
.In
/etc/postfix/transport
you combine these two:local_transport
(default:local:$myhostname
)* transport:nexthop
Resulting:
* local:$myhostname
Please keep this unconventional configuration inside your lab.