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:    l...@agneau.org
> > owner-debuglolo-outgoing:   owner-debugl...@listes2.agneau.org
> > debuglolo-outgoing: :include:/usr/local/etc/postfix/lists/debuglolo
> > 
> > mail# cat lists/debuglolo
> > lfriga...@agneau.org
> > 
> > 
> > test command to reproduce the problem:
> > 
> > printf 'From: Laurent Frigault <lfriga...@agneau.org>\nTo: 
> > debugl...@listes2.agneau.org\nSubject: test\n\ntest\n' |sendmail -oi -oee 
> > -fowner-debugl...@listes2.agneau.org debuglolo-outgo...@listes2.agneau.org
> > 
> > The enveloppe sender owner-debugl...@listes2.agneau.org if rewritten to
> > owner-debuglolo-outgo...@mail.agneau.org instead of 
> > owner-debuglolo-outgo...@listes2.agneau.org
> 
> If sending to debuglolo-outgoing, Postfix will replace the sender with
> one of the following:
> 
> 1) owner-debugl...@listes2.agneau.org (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
owner-debugl...@listes2.agneau.org to
owner-debuglolo-outgo...@listes2.agneau.org

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
owner-debuglolo-outgo...@mail.agneau.org        
owner-debuglolo-outgo...@listes2.agneau.org

Do you have a better solution ?


-- 
Laurent Frigault | <url:http://www.agneau.org/>

Reply via email to