Hi Postfix users,

For some reason, I would like my sender address to be altered,
depending on the recipient domain.
It's quite simple: when I send an email to j...@myexample.com domain,
the FROM header must be changed to "mys...@myexample.com" instead of
mys...@myhostname.com".

Here is my (non working) config to achieve this

1. master.conf
out_new  unix -       -       n       -       -       smtp
    -o smtp_helo_name=myexample.com
    -o sender_canonical_maps=regexp:/etc/postfix/generic_toext

2. /etc/postfix/generic_toext
/^(.*)@(.*)myhostname\.com/      $1...@myexample.com

3. /etc/postfix/transport
myexample.com            out_new:

4. main.cf
transport_maps = hash:/etc/postfix/transport

This is NOT working, and I have no idea why.
Based on logs, I see that mails to myexample.com are correctly sent
using "out_new", but the sender_canonical_maps is ignored (I checked
twice: the regex is working fine)

Now, if I put the sender_canonical_maps setting in main.cf, it's
working ! (only problem is that my FROM is changed for each message I
send).

Can anybody explain me why the sender_canonical_maps setting seems
ignored when it's written in master.cf ?

Do you any solution or workarround to make it work ?

Thanks,
cheers, julien

Reply via email to