Use a single server to host email for multiple domains wqithout having to create a UNIX system account for every email.
postmap /etc/postfix/virtual
after changing the virtual file, and execute the command postfix reload
after changing the main.cf
file.# /etc/postfix/main.cf
virtual_alias_domains = example.com ...other hosted domains...
virtual_alias_maps = hash:/etc/postfix/virtual
# /etc/postfix/virtual
postmaster@example.com postmaster
info@example.com joe
sales@example.com jane
# Uncomment entry below to implement a catch-all address
# @example.com jim
...virtual aliases for more domains...
Maildir
style delivery where a mailbox pathname is used instead of a UNIX system account is used can be used to create virtual mailboxes. That way you don’t have to create a system account for every user that you want to give email accesss to.
Maildir style delivery is turned on by terminating the mailbox pathname with /
.
# Virtual Mailbox related config
# /etc/postfix/main.cf
virtual_mailbox_domains = example.com ...more domains...
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 100
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_alias_maps = hash:/etc/postfix/virtual
# /etc/postfix/vmailbox:
info@example.com example.com/info
sales@example.com example.com/sales/
# Comment out the entry below to implement a catch-all.
# @example.com example.com/catchall
...virtual mailboxes for more domains...
# /etc/postfix/virtual:
postmaster@example.com postmaster