On 8/8/2016 1:21 PM, Julien Sansonnens wrote: > 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 [email protected] domain, > the FROM header must be changed to "[email protected]" instead of > [email protected]". > > 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
sender_canonical_maps is a property of the cleanup service, not smtp, so you can't override that setting here. > > 2. /etc/postfix/generic_toext > /^(.*)@(.*)myhostname\.com/ [email protected] You can probably use this same regexp with smtp_header_checks to achieve your goal. You /can/ use a custom smtp_header_checks setting in a master.cf smtp transport. http://www.postfix.org/postconf.5.html#smtp_header_checks -- Noel Jones
