Fedora Email Forwarding (Postfix)
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?
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 [email protected]
@someotherdomain.com [email protected]
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.
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 [email protected] postmaster
7 [email protected] joe@somewhere
8 [email protected] 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"