I just started playing around with sender address rewriting with postfix.
I run a server with debian-7.11
and postfix-2.9.6
.
Content of /etc/postfix/main.cf
:
[...]
smtp_generic_maps = hash:/etc/postfix/generic
[...]
Content of /etc/postfix/generic
:
santiago@uranus.caoba.fr santiago.uranus.caoba.fr@caoba-mail.fr
auguste@uranus.caoba.fr auguste.uranus.caoba.fr@caoba-mail.fr
And so far it works. When user santiago
sends an email, it is sent as santiago.uranus.caoba.fr@caoba-mail.fr
which is what I want.
My problem is that I want this rewrite to be performed with any user without having to add more lines to /etc/postfix/generic
. So I was wondering if it could be done via some kind of regular expression like:
(.*)@$hostname $1.$hostname@caoba-mail.fr
Is it at all possible?
Thanks for your help
Santiago