Frank Reid: > Scenario: I would like to deliver all mail for the @example.com domain to a > single mailbox as a single delivery (to preserve header information). I > have set up: > > -- main.cf > virtual_alias_domains = example.com > virtual_alias_maps = hash:/etc/postfix/virtual > > -- virtual > @example.com mail...@mydomain.com > > This works fine, and all @example.com mail goes to mail...@mydomain.com. > (The mailbox is a Dovecot mailbox, if that matters.) > > The problem is that I get a separate copy for every user under @example.com > to the other mailbox. For example, if the original mail is addressed to > us...@example.com and us...@example.com, I will receive two copies in > mail...@mydomain.com.
By default, Postfix makes one delivery per original recipient. Some organizations receive all their mail in a single mailbox, and need to split out the mail after dowloading it with fetchmail etc. (For this, the delivery agent meeds to be configured to prepend an X-Original-To: header with the original recipient address. This is the default with Postfix's built-in mailbox delivery agents, but needs to be configured explicitly when using an external mailbox delivery agent such as Dovecot.) > Is it possible to consolidate into a single delivery using this method? > I've looked at address rewrite, but I would like to keep the original header > intact showing the intended recipients, if that's possible. Yes it is possible. However, I need to warn you first about a mis-conception. The To: header is NOT a reliable indicator of the intended recipient. For example, this message is sent To: postfix-users@postfix.org, yet it arrives in your mailbox. It would be a mistake to make mail delivery decisions based on the information in the To: header. To turn off the original recipient logic in virtual aliases, see http://www.postfix.org/postconf.5.html#enable_original_recipient Wietse