Setting up postfix for virtual mail hosts

After setting up name-based virtual web hosting for Apache, I’ve just set up virtual mail hosting for my new company, Printscreen GmbH, using postfix – and it was amazingly simple! :) For some basic virtual mail hosting using normal UNIX/Linux user accounts, all you need is a plain-text file (‘/etc/postfix/virtual’) that maps virtual mail addresses to the actual user accounts and two additional lines in

/etc/postfix/virtual: postmaster
# Uncomment entry below to implement a catch-all address
# jim

virtual_alias_domains =
virtual_alias_maps = hash:/etc/postfix/virtual

Then just execute

# postmap /etc/postfix/virtual && /etc/init.d/postfix reload


The nice postfix readme file for this and some more complicated virtual mail hosting configurations:

Another, possibly helpful howto (search):

For setups using a MySQL database as a backend for storing the mappings, see Google. I currently don’t need this and hence don’t like to introduce any unnecessary MySQL dependency to my postfix server – remember the KISS principle ;)