Catch-All virtual mail domain with postfix

Posted on August 26, 2014
postfix, email

This is a neat trick to set up a self-contained mail server for software testing purposes.

Add this to

virtual_alias_domains =
virtual_alias_maps = hash:/etc/virtual-aliases

And create a /etc/virtual-aliases file with this: root

Then run

postmap /etc/virtual-aliases
postfix reload

Now all e-mails sent to * will end up in root’s mailbox.