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 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
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/ $1...@myexample.com 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