Ubuntu Postfix Configuration – Forward All Incoming Email to Single Address

gmailpostfixUbuntu

I've a Ubuntu 9.04 server installation which is hosting a small number of websites (currently two, and will remain in single figures). The email requirements for the server are very limited – to send outgoing emails and forward all incoming emails to a mailbox on another server – most likely Google.

I've installed postfix and the outgoing mail is working fine. How do I configure Postfix to forward all incoming mail? If I send it to a googlemail address are there any special considerations? Finally how difficult is it to incorporate basic spam filtering into the forwarding mechanism?

Best Answer

This is called a "catch all"

Mapping is done using /etc/postfix/virtual file.

vi /etc/postfix/virtual

Append code as follows, replacing domain and emailusername with actual values:

@yourdomain.com emailusername

Save and close the file. Run following command:

postmap /etc/postfix/virtual

Also make sure you have following line in /etc/postfix/main.cf file:

virtual_alias_maps = hash:/etc/postfix/virtual

If you just added above, line reload postfix:

service postfix reload

From http://www.cyberciti.biz/faq/howto-setup-postfix-catch-all-email-accounts/

Related Topic