Jie Wang wrote: > Hello, everyone, > > I need to duplicate all the email messages for one destination server > and send the copies to another destination. More specifically, I need > to send all the original emails to destination1.com and send all the > copies to destination2.com. Both destination1.com and destination2.com > have the identical user names. How do I achieve this with Postfix acting > like a gateway/proxy? > > Thanks. > > Jie Wang >
This is a FAQ, asked a couple times this week already. But I'm feeling generous, so here's the answer again. Postfix delivers mail to recipients. Each recipient must have exactly one final destination. To deliver to multiple destinations, you need multiple recipients. Use virtual_alias_maps (not virtual_alias_domains) or recipient_bcc_maps to add a second recipient. Although there is some overlap of which method to use when, generally one would use virtual_alias_maps to duplicate mail for specified users, and recipient_bcc_maps to duplicate mail for everyone in a specific domain. a bare-bones example: # main.cf virtual_alias_maps = hash:/etc/postfix/virtual smtp_generic_maps = hash:/etc/postfix/generic # virtual_alias_maps [EMAIL PROTECTED] [EMAIL PROTECTED], [EMAIL PROTECTED] # smtp_generic_maps @server2.example.com @example.com Alternate example using recipient_bcc_maps: # main.cf recipient_bcc_maps = regexp:/etc/postfix/recipient_bcc.regexp smtp_generic_maps = hash:/etc/postfix/generic # recipient_bcc.regexp /^(.*)@example\.com$/ [EMAIL PROTECTED] # smtp_generic_maps @server2.example.com @example.com -- Noel Jones