[SOLVED] Translate/Amend inbound email addresses

frankbyrne

New Member
Apr 21, 2021
3
2
3
52
Hi

We have a number of users setup in on-premise Exchange with apostrophe in their email address - fred.o'flintstone@bedrock.com for example.

Implementing Azure AD sync, these have been flagged to be amended. Obviously changing the primary address on Exchange is easy; but for users who will be receiving email from many externa sources, the old address is invariably going to be used for some time.

Can we implement some mechanism to strip out the apostrophe on incoming emails for these users before the mail is handed to Exchange?

Thanks.

Frank
 
Can we implement some mechanism to strip out the apostrophe on incoming emails for these users before the mail is handed to Exchange?
not via PMG's GUI (address rewriting is not a thing that should be done on the antispam/antivirus mailproxy)

However postfix (the MTA used by PMG) probably can accomplish that - I'd start reading on their howto's:
http://postfix.cs.utah.edu/ADDRESS_REWRITING_README.html#delivering

in order to change the postfix configuration on PMG you need to use the templateing system:
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_template_engine

I hope this helps!
 
For some future poor soul who may need this - thanks @Stoiko Ivanov for pointing me in the right direction.

Rightly or wrongly, this approach has worked for me....


Created a file /etc/postfix/recipient_canonical

Added lines like this
Code:
#
# /etc/postfix/recipient_canonical
#
neil.o'surname@mydomain.ie       neil.osurname@mydomain.ie
frank.o'something@mydomain.ie        frank.osomething@mydomain.ie
Modify /etc/pmg/templates/main.cf.in

Add in this:
Code:
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical

Close and save, then run the following commands:

Code:
postmap /etc/postfix/recipient_canonical
postfix reload
pmgconfig sync --restart 1
 
Last edited:
Great that that worked out! :) - Thanks for coming back and sharing your solution!

Please mark threads as 'SOLVED' (by editing them and selecting the 'SOLVED' prefix) - for the next time - this time I did that already

Thanks again for summarizing your solution
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!