On 11/2/2017 7:48 AM, nico...@devels.es 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 > r...@internal-domain.com by default, but if the recipient is > u...@external-domain.com I want to rewrite sender to be > r...@different-domain.com. > > 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): > u...@external-domain.com toext: > > 3) Content of /etc/postfix/generic_toext (postmapped): > r...@internal-domain.com r...@different-domain.com > > 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