giovedì 4 agosto 2011

Rewriting addresses in Postfix with regular expressions

Today my employer asked me to look into Postfix. We should take an address like and make it into

Looking at the (good) documentation from Postfix, I managed to get a solution. You should change in /etc/postfix/

canonical_maps = regexp:/etc/postfix/rewrite

and the /etc/postfix/rewrite file will contain:

/^(.*)@(.*)\.local\.lan$/     ${1}.${2}@domain.tld

Nessun commento:

Posta un commento