Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to forward all email sent to non-existant users on my fedora server to my gmail account. Is there a simple way to do this?

How would I forward all email?

share|improve this question
add comment

2 Answers 2

Set "mydestination=" in main.cf to include the domains that you receive mail for. You will need to make sure that each of those resolves correctly in DNS, I believe.

Then add or edit "virtual_alias_maps" in main.cf to look like this:

virtual_alias_maps = hash:/etc/postfix/virtual

Then add the domains to /etc/postfix/virtual:

@example.org     you@gmail.com
@someotherdomain.com   you@gmail.com

run postmap /etc/postfix/virtual

and restart postfix if you edited main.cf at all.

This will forward mail sent to example.org and someotherdomain.com to your gmail account.

share|improve this answer
add comment

Did you try to read Postfix docs? Postfix Virtual Domain Hosting Howto is your best friend, Mail forwarding domains chapter, if I'll show topic-for-you

 1 /etc/postfix/main.cf:
 2     virtual_alias_domains = example.com ...other hosted domains...
 3     virtual_alias_maps = hash:/etc/postfix/virtual
 4 
 5 /etc/postfix/virtual:
 6     postmaster@example.com postmaster
 7     joe@example.com        joe@somewhere
 8     jane@example.com       jane@somewhere-else
 9     # Uncomment entry below to implement a catch-all address
10     # @example.com         jim@yet-another-site

Line 10: The commented out entry (text after #) shows how one would implement a catch-all virtual alias that receives mail for every example.com address not listed in the virtual alias file

RTFM, "postmaster"

share|improve this answer
    
I wanted to forward mail from any domain. –  Richard - Rogue Wave Limited Mar 1 '12 at 14:07
    
@Richard-RogueWaveLimited - add one wildcarded alias for every domain in virtual_alias_domains –  Lazy Badger Mar 1 '12 at 14:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.