John Perkins
Systems Engineer
I'm looking for a (preferably clean) way of rewriting messages on our incoming email gateway running Postfix.
Our situation: our university's central IT group changed mail filtering vendors recently, which changes which formats we can use to forward to the cloud-hosted email service in use here. Previously, emails addressed to USER@DOMAIN_A could be rerouted to USER%DOMAIN_A@DOMAIN_B where DOMAIN_A is our department domain and DOMAIN_B is the campus-wide email domain. Aliases within our email domain DOMAIN_A are hosted on an LDAP server directed to USER%DOMAIN_A@DOMAIN_B for user USER.
The new filtering service won't accept this address construct...but we have found it will accept @DOMAIN_B:USER@DOMAIN_A instead.
I had high hopes we could do a regexp or pcre smtp_generic_map such as this:
/^(.*)%DOMAIN_A@DOMAIN_B$/ @DOMAIN_B:${1}@DOMAIN_A
...but I'm finding this mapping is not being applied.
I did try adding a transport_map:
USER%DOMAIN_A@DOMAIN_B virtualDOMAIN_B:USER@DOMAIN_A
...which also did not have an effect.
Can anyone suggest the proper way to go about this sort of address rewrite?
Our situation: our university's central IT group changed mail filtering vendors recently, which changes which formats we can use to forward to the cloud-hosted email service in use here. Previously, emails addressed to USER@DOMAIN_A could be rerouted to USER%DOMAIN_A@DOMAIN_B where DOMAIN_A is our department domain and DOMAIN_B is the campus-wide email domain. Aliases within our email domain DOMAIN_A are hosted on an LDAP server directed to USER%DOMAIN_A@DOMAIN_B for user USER.
The new filtering service won't accept this address construct...but we have found it will accept @DOMAIN_B:USER@DOMAIN_A instead.
I had high hopes we could do a regexp or pcre smtp_generic_map such as this:
/^(.*)%DOMAIN_A@DOMAIN_B$/ @DOMAIN_B:${1}@DOMAIN_A
...but I'm finding this mapping is not being applied.
I did try adding a transport_map:
USER%DOMAIN_A@DOMAIN_B virtualDOMAIN_B:USER@DOMAIN_A
...which also did not have an effect.
Can anyone suggest the proper way to go about this sort of address rewrite?