LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Postfix relay alias or bcc? (http://www.linuxquestions.org/questions/linux-software-2/postfix-relay-alias-or-bcc-4175413838/)

bobbrandt 06-28-2012 10: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 email.address@domain.com it will send it to email.address@domain.com AND email.address@new.domain.com.
  2. If an email comes in for email.address@new.domain.com it will send it to email.address@new.domain.com.
  3. If an email comes in for email.address@old.domain.com it will send it to email.address@domain.com.
(I have already setup the new system to rewrite the addresses so it changes @new.domain.com to @domain.com)

At first I tried a combination of recipient_canonical_maps and recipient_bcc_maps, but it fails when it receives an email for email.address@old.domain.com. Instead of sending it JUST to email.address@domain.com it first changes the address to email.address@domain.com 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:
Code:

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

# Transport Map

/^(.*)@domain.com/      smtp:[mailserver.domain.com]
/^(.*)@new.domain.com/  smtp:[newmailserver.domain.com]

Thanks
Bob

lithos 06-29-2012 03:25 AM

Hi,

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 06:01 AM

Thanks,

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

Bob

bobbrandt 07-03-2012 09: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.

Thanks
Bob

lithos 07-03-2012 11: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 09:46 PM.