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:
- If an email comes in for firstname.lastname@example.org it will send it to email@example.com AND firstname.lastname@example.org.
- If an email comes in for email@example.com it will send it to firstname.lastname@example.org.
- If an email comes in for email@example.com it will send it to firstname.lastname@example.org.
(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@example.com
. Instead of sending it JUST to firstname.lastname@example.org
it first changes the address to email@example.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:
postfix/trivial-rewrite: warning: regexp map /etc/postfix/transport, line 3: ignoring unrecognized request
Where my transport file is:
# Transport Map