Replace domU below with the hostname of your virtual machine and username with your personal user account.
On domU
Install a mail transfer agent and imap server
sudo apt-get install postfix dovecotSet up postfix
Create a /etc/postfix/virtual file with entries like so:
@domU username@domU
@localhost username@domUGenerate the virtual.db:
postmap /etc/postfix/virtualTell postfix about your new virtual setup by adding the following to /etc/postfix/main.cf:
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains = domU, localhostRestart postfix:
/etc/init.d/postfix restartSet up dovecot
In /etc/dovecot/dovecot.conf, find this line:
#protocols = imap imapsChange it to:
protocols = imapRestart dovecot:
sudo /etc/init.d/dovecot restartOn dom0
Set up a new account in your favorite mail reader:
- Protocol: IMAP
- Host: domU
- User: username
You will now receive all mails to foo@domU, bar@domU, etc.

