owner_request_special issue in postfix 3.2.3

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

owner_request_special issue in postfix 3.2.3

Laurent Frigault
Hi,

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)

mail# diff main.cf.sample main.cf
95a96
> myhostname = mail.agneau.org
102a104
> mydomain = agneau.org
118a121
> myorigin = mail.agneau.org
134a138
> inet_interfaces = 127.0.1.5
182a187
> mydestination = mail.agneau.org, listes2.agneau.org, listes3.agneau.org
311a317
> relay_domains = agneau.org bergerie.agneau.org
403a410
> alias_maps = hash:$config_directory/aliases
412a420
> alias_database = hash:$config_directory/aliases

My debug aliases in $config_directory/aliases :

owner-debuglolo: [hidden email]
owner-debuglolo-outgoing: [hidden email]
debuglolo-outgoing: :include:/usr/local/etc/postfix/lists/debuglolo

mail# cat lists/debuglolo
[hidden email]


test command to reproduce the problem:

printf 'From: Laurent Frigault <[hidden email]>\nTo: [hidden email]\nSubject: test\n\ntest\n' |sendmail -oi -oee -[hidden email] [hidden email]

The enveloppe sender [hidden email] if rewritten to
[hidden email] instead of [hidden email]

both mail.agneau.org and listes2.agneau.org are in mydestination so
there is no reason to rewrite the right part of the sender from
listes2.agneau.org to mail.agneau.org

/var/log/maillog :

Dec  7 15:34:08 mail postfix/pickup[6509]: AA6114D16: uid=0 from=<[hidden email]>
Dec  7 15:34:08 mail postfix/cleanup[6515]: AA6114D16: message-id=<[hidden email]>
Dec  7 15:34:08 mail postfix/qmgr[6510]: AA6114D16: from=<[hidden email]>, size=314, nrcpt=1 (queue active)
Dec  7 15:34:08 mail postfix/cleanup[6515]: AF13E4D17: message-id=<[hidden email]>
Dec  7 15:34:08 mail postfix/local[6517]: AA6114D16: to=<[hidden email]>, relay=local, delay=0.07, delays=0.05/0/0/0.01, dsn=2.0.0, status=sent (forwarded as AF13E4D17)
Dec  7 15:34:08 mail postfix/qmgr[6510]: AF13E4D17: from=<[hidden email]>, size=461, nrcpt=1 (queue active)
Dec  7 15:34:08 mail postfix/qmgr[6510]: AA6114D16: removed
Dec  7 15:34:08 mail postfix/smtp[6518]: AF13E4D17: to=<[hidden email]>, relay=obelix.agneau.org[88.173.248.15]:25, delay=0.24, delays=0.01/0.01/0.07/0.15, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as CBF4F1D674F)
Dec  7 15:34:08 mail postfix/qmgr[6510]: AF13E4D17: removed

I attached 2 files:

postconf.txt.gz result of postconf
maillog-verbose.txt.gz  maillog content with -v flags added to local

It looks like a bug in owner_request_special handling to me, because I
have a very similar configuration on an old postfix 2.8.1 that does not
alter the right part of the sender but I may have missed something.

I reproduce the same problem in an other jail with postfix 2.11.10 so
this is probably not a postfix 2 vs postfix 3 difference.

man 8 local is not very verbose about owner_request_special :

       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 "-".

It is only about localparts, nothing about right(domain) part .

Any idea on how to prevent owner_request_special from altering the right
part of the sender ? This is needed if you want to host lists in many
domains on the same postfix.

Is it a bug in local or in my configuration ?

Regards,

--
Laurent Frigault | <url:http://www.agneau.org/>
Quand on parle pognon, à partir d'un certain chiffre, tout le monde
écoute. (Michel Audiard)

postconf.txt.gz (10K) Download Attachment
maillog-verbose.txt.gz (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: owner_request_special issue in postfix 3.2.3

Wietse Venema
Laurent Frigault:
> Hi,
>
> 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.

Does the 'unexpected behavior' depend on the owner_request_special setting?

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: owner_request_special issue in postfix 3.2.3

Laurent Frigault
On Thu, Dec 07, 2017 at 03:18:40PM -0500, Wietse Venema wrote:
> Laurent Frigault:

> > 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.
>
> Does the 'unexpected behavior' depend on the owner_request_special setting?

Yes.

If I set owner_request_special to no , the sender address is not
changed at all. No change on the local part and no change on the right
part which is expected behavior.

The problem is with owner_request_special set to yes (default). The
rewrite of the local part of the sender is correct and expected , but
the right part should not have been changed.

--
Laurent Frigault | <url:http://www.agneau.org/>
Reply | Threaded
Open this post in threaded view
|

Re: owner_request_special issue in postfix 3.2.3

Wietse Venema
In reply to this post by Laurent Frigault
Laurent Frigault:
[ Charset ISO-8859-15 converted... ]

> Hi,
>
> 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)
>
> mail# diff main.cf.sample main.cf
> 95a96
> > myhostname = mail.agneau.org
> 102a104
> > mydomain = agneau.org
> 118a121
> > myorigin = mail.agneau.org
> 134a138
> > inet_interfaces = 127.0.1.5
> 182a187
> > mydestination = mail.agneau.org, listes2.agneau.org, listes3.agneau.org
> 311a317
> > relay_domains = agneau.org bergerie.agneau.org
> 403a410
> > alias_maps = hash:$config_directory/aliases
> 412a420
> > alias_database = hash:$config_directory/aliases
>
> My debug aliases in $config_directory/aliases :
>
> owner-debuglolo: [hidden email]
> owner-debuglolo-outgoing: [hidden email]
> debuglolo-outgoing: :include:/usr/local/etc/postfix/lists/debuglolo
>
> mail# cat lists/debuglolo
> [hidden email]
>
>
> test command to reproduce the problem:
>
> printf 'From: Laurent Frigault <[hidden email]>\nTo: [hidden email]\nSubject: test\n\ntest\n' |sendmail -oi -oee -[hidden email] [hidden email]
>
> The enveloppe sender [hidden email] if rewritten to
> [hidden email] instead of [hidden email]

If sending to debuglolo-outgoing, Postfix will replace the sender with
one of the following:

1) [hidden email] (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).

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: owner_request_special issue in postfix 3.2.3

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

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
[hidden email] [hidden email]

Do you have a better solution ?


--
Laurent Frigault | <url:http://www.agneau.org/>
Reply | Threaded
Open this post in threaded view
|

Re: owner_request_special issue in postfix 3.2.3

Wietse Venema
Laurent Frigault:
> owner-debuglolo: [hidden email]
> owner-debuglolo-outgoing: [hidden email]
> debuglolo-outgoing: :include:/usr/local/etc/postfix/lists/debuglolo

Wietse:

> > If sending to debuglolo-outgoing, Postfix will replace the sender with
> > one of the following:
> >
> > 1) [hidden email] (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.

This feature works as documented. IT REPLACES THE ENTIRE SENDER
regardless of what the sender was.

> I need the sender address to be rewritten from
> [hidden email] to
> [hidden email]

Then use canonical_maps. Postfix owner featres do not rewrite
addresses, they REPLACE addresses regardless of what the sender
was.

        Wietse