-   Linux - Software (
-   -   Postfix relay alias or bcc? (

bobbrandt 06-28-2012 09:30 AM

Postfix relay alias or bcc?
Very quickly - I am creating a test email system for a company and I want to populate the new system with live data. Both systems are using the same email addresses as they look at the same LDAP source. And I want to make as few changes to the live system as possible. The only change I want to make is to introduce one addition smart host which will relay mail to the two systems.

So, what I need is a very simple postfix relay system that will do the following:
  1. If an email comes in for it will send it to AND
  2. If an email comes in for it will send it to
  3. If an email comes in for it will send it to
(I have already setup the new system to rewrite the addresses so it changes to

At first I tried a combination of recipient_canonical_maps and recipient_bcc_maps, but it fails when it receives an email for Instead of sending it JUST to it first changes the address to and then adds the BCC which might cause in infinite loop with the other systems.

I have also looked at using an ALIAS file, but it looks like it is only for Local Users and this machine needs to relay all mail.

I have also looked at using a virtual_alias_maps but it seems that the system does not want to send virtual domains and users via SMTP. Whenever I try I get an error:

postfix/trivial-rewrite[18227]: warning: regexp map /etc/postfix/transport, line 3: ignoring unrecognized request
Where my transport file is:

# Transport Map

/^(.*)      smtp:[]
/^(.*)  smtp:[]


lithos 06-29-2012 02:25 AM


I don't know the exact configuration you need, but I would see the "relay_domains" parameter (around middle of the page) to try it.
It seems to me that is what you need ?

good luck

bobbrandt 06-29-2012 05:01 AM


But I got the relay part working fine. The problem I am having is with the address rewriting.


bobbrandt 07-03-2012 08:52 AM

I was able to get the system working by using multiple postfix instances on the same host.

I used the first (my postfix-in instance) to accept the mail and add the correct BCC addresses. Then used the second (my postfix-out instance) to rewrite the addresses and deliver the mail.


lithos 07-03-2012 10:14 AM

Great !

Would you mind posting the needed configuration lines which you have set (removing/ blending any addresses)
for future references for anyone that may search for postfix.

Thank you.

Best Regards.

All times are GMT -5. The time now is 11:29 AM.