Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forwarding email with recipient rewrite

Status
Not open for further replies.

John Perkins

Systems Engineer
Jun 20, 2023
1
US
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 virtual:mad:DOMAIN_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?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top