On Thu, Dec 07, 2017 at 07:16:22PM -0500, Wietse Venema wrote: > > I have an issue with owner_request_special . It rewrites correctly the > > local part of the sender address BUT, it replaces the right part of the > > sender address with myorigin (or myhostname) instead of keeping it. > > > > My config : > > OS: FreeBSD 11.1-RELEASE-p4 > > postfix: postfix-3.2.3,1 (from freebsd package) > > > > > myhostname = mail.agneau.org > > > mydomain = agneau.org > > > myorigin = mail.agneau.org > > > mydestination = mail.agneau.org, listes2.agneau.org, listes3.agneau.org > > > relay_domains = agneau.org bergerie.agneau.org > > > alias_maps = hash:$config_directory/aliases > > > alias_database = hash:$config_directory/aliases > > My debug aliases in $config_directory/aliases : > > > > owner-debuglolo: [email protected] > > owner-debuglolo-outgoing: [email protected] > > debuglolo-outgoing: :include:/usr/local/etc/postfix/lists/debuglolo > > > > mail# cat lists/debuglolo > > [email protected] > > > > > > test command to reproduce the problem: > > > > printf 'From: Laurent Frigault <[email protected]>\nTo: > > [email protected]\nSubject: test\n\ntest\n' |sendmail -oi -oee > > [email protected] [email protected] > > > > The enveloppe sender [email protected] if rewritten to > > [email protected] instead of > > [email protected] > > If sending to debuglolo-outgoing, Postfix will replace the sender with > one of the following: > > 1) [email protected] (expand_owner_alias = yes) > > 2) owner-debuglolo-outgoing (expand_owner_alias = no) which then > becomes owner-debuglolo-outgoing@$myorigin. > > You appear to have configured Postfix to do 2).
None of the 2 are what I need. I need the sender address to be rewritten from [email protected] to [email protected] There is nothing in local(8) man page saying that owner_request_special will replace the right part by $myorigin owner_request_special (yes) Give special treatment to owner-listname and listname-request address localparts: don't split such addresses when the recipient_delimiter is set to "-". For now, the only solution I found working , is to use sender_canonical_maps to fix the rewritten domain part : sender_canonical_classes = envelope_sender sender_canonical_maps = hash:$config_directory/sender_canonical mail# cat sender_canonical [email protected] [email protected] Do you have a better solution ? -- Laurent Frigault | <url:http://www.agneau.org/>
