On 11/2/2017 7:48 AM, [email protected] wrote: > Hi, > > I'm running Postfix 2.9.6 and I'm trying to do a conditional sender > rewrite based on recipient address. Machine sends e-mails as > [email protected] by default, but if the recipient is > [email protected] I want to rewrite sender to be > [email protected]. > > To do so, I've tried doing the following: > > 1) In master.cnf I added: > toext unix - - n - - smtp -o > canonical_maps=hash:/etc/postfix/generic_toext > > 2) In the transport_maps map I added (and postmapped): > [email protected] toext: > > 3) Content of /etc/postfix/generic_toext (postmapped): > [email protected] [email protected] > > This seems not to work, as the original sender is still the same. As > per [1] something like this could be done by using the > canonical_maps parameter, however it doesn't seem to work in the way > I'm using it. Could someone point me what's wrong in the > configuration above?
canonical_maps cannot be used as a -o override on a transport. Postfix is not able to perform conditional sender rewrite based on the recipient address. You can use a milter to do this. -- Noel Jones
