unionmap?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

unionmap?

Marek Kozlowski-2
:-)

 unionmap (read-only)
    A table that sends each query to multiple lookup tables and that
concatenates all found results, separated by comma. The table name
syntax is the same as for pipemap tables.
(http://www.postfix.org/DATABASE_README.html#types)

Seems a little unclear to me how it works :-( Maybe by example. Let's
assume:

virtual_alias_maps = unionmap:{sth1, sth2}

What is the result of `rcpt to:' set to `someone1' in the original mail?

if:
`sth1' maps someone1 -> someone2,someone3
`sth2' maps someone3 -> someone4

if:
`sth1' maps someone1 -> someone2,someone3
        and someone4 -> someone5
`sth2' maps someone1 -> someone4

if:
`sth1' maps someone1 -> someone2
`sth2' maps someone2 -> someone1

if:
`sth1' maps someone1 -> someone2
        and someone3 -> someone4
`sth2' maps someone1 -> someone3
        and someone2 -> someone5

Best regards,
Marek


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Wietse Venema
Marek Kozlowski:

>  unionmap (read-only)
>     A table that sends each query to multiple lookup tables and that
> concatenates all found results, separated by comma. The table name
> syntax is the same as for pipemap tables.
> (http://www.postfix.org/DATABASE_README.html#types)
>
> Seems a little unclear to me how it works :-( Maybe by example. Let's
> assume:
>
> virtual_alias_maps = unionmap:{sth1, sth2}

virtual_alias_maps lookups are recursive, therefore every result
address is also subject to virtual_alias_maps lookups. The recursion
ends when an address expands into itself, to avoid going into a loop.

As for the questions, you can simulate that by hand.

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Marek Kozlowski-2
In reply to this post by Marek Kozlowski-2
On 02/21/2017 08:00 PM, Marek Kozlowski wrote:

> Maybe by example. Let's assume:

I've just checked :-)

> virtual_alias_maps = unionmap:{sth1, sth2}

Note: `unionmap' available since postfix 3.0!

> What is the result of `rcpt to:' set to `someone1' in the original mail?
>
> if:
> `sth1' maps someone1 -> someone2,someone3
> `sth2' maps someone3 -> someone4

someone2, someone4

> if:
> `sth1' maps someone1 -> someone2,someone3
> and someone4 -> someone5
> `sth2' maps someone1 -> someone4

someone2, someone3, someone5

> if:
> `sth1' maps someone1 -> someone2
> `sth2' maps someone2 -> someone1

ERROR! Message not delivered due to recursion!

> if:
> `sth1' maps someone1 -> someone2
> and someone3 -> someone4
> `sth2' maps someone1 -> someone3
> and someone2 -> someone5

someone4, someone5

Best regards,
Marek




smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Wietse Venema
Marek Kozlowski:
> > virtual_alias_maps = unionmap:{sth1, sth2}
> > if:
> > `sth1' maps someone1 -> someone2
> > `sth2' maps someone2 -> someone1
>
> ERROR! Message not delivered due to recursion!

You can do the exacts same with just one table:

    a->b
    b->a

will produce 'unreasonable virtual_alias_maps map nesting for a --
message not accepted, try again later'.

So don't do that.

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Marek Kozlowski-2
On 02/22/2017 01:16 AM, Wietse Venema wrote:

> Marek Kozlowski:
>>> virtual_alias_maps = unionmap:{sth1, sth2}
>>> if:
>>> `sth1' maps someone1 -> someone2
>>> `sth2' maps someone2 -> someone1
>>
>> ERROR! Message not delivered due to recursion!
>
> You can do the exacts same with just one table:
>
>     a->b
>     b->a
>
> will produce 'unreasonable virtual_alias_maps map nesting for a --
> message not accepted, try again later'.
Why in this case:

`sth1': someone1 -> someone1,someone2
`sth2': someone2 -> someone3

someone3 receives the mail in two copies??
(someone1 receives it once)

Best regards,
Marek


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Wietse Venema
Marek Kozlowski:
[ Charset ISO-8859-2 converted... ]

> On 02/22/2017 01:16 AM, Wietse Venema wrote:
> > Marek Kozlowski:
> >>> virtual_alias_maps = unionmap:{sth1, sth2}
> >>> if:
> >>> `sth1' maps someone1 -> someone2
> >>> `sth2' maps someone2 -> someone1
> >>
> >> ERROR! Message not delivered due to recursion!
> >
> > You can do the exacts same with just one table:
> >
> >     a->b
> >     b->a
> >
> > will produce 'unreasonable virtual_alias_maps map nesting for a --
> > message not accepted, try again later'.
>
> Why in this case:
>
> `sth1': someone1 -> someone1,someone2
> `sth2': someone2 -> someone3
>
> someone3 receives the mail in two copies??
> (someone1 receives it once)

Set "enable_original_recipient = no" if you don't want that, and
see http://www.postfix.org/postconf.5.html#enable_original_recipient
for why this rain damage exists.

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Marek Kozlowski-2
On 02/22/2017 12:37 PM, Wietse Venema wrote:

> Marek Kozlowski:
> [ Charset ISO-8859-2 converted... ]
>> On 02/22/2017 01:16 AM, Wietse Venema wrote:
>>> Marek Kozlowski:
>>>>> virtual_alias_maps = unionmap:{sth1, sth2}
>>>>> if:
>>>>> `sth1' maps someone1 -> someone2
>>>>> `sth2' maps someone2 -> someone1
>>>>
>>>> ERROR! Message not delivered due to recursion!
>>>
>>> You can do the exacts same with just one table:
>>>
>>>     a->b
>>>     b->a
>>>
>>> will produce 'unreasonable virtual_alias_maps map nesting for a --
>>> message not accepted, try again later'.
>>
>> Why in this case:
>>
>> `sth1': someone1 -> someone1,someone2
>> `sth2': someone2 -> someone3
>>
>> someone3 receives the mail in two copies??
>> (someone1 receives it once)
>
> Set "enable_original_recipient = no" if you don't want that, and
> see http://www.postfix.org/postconf.5.html#enable_original_recipient
> for why this rain damage exists.
No, it has nothing to do. With both settings it works the same.

Moreover:

`sth1': someone1 -> someone1,someone2
`sth2': someone2 -> someone2,someone3

`someone1' receives one copy, `someone2' - two...  and `someone3' - three...

Best regards,
Marek


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Wietse Venema
Marek Kozlowski:
[ Charset ISO-8859-2 converted... ]

> On 02/22/2017 12:37 PM, Wietse Venema wrote:
> > Marek Kozlowski:
> > [ Charset ISO-8859-2 converted... ]
> >> On 02/22/2017 01:16 AM, Wietse Venema wrote:
> >>> Marek Kozlowski:
> >>>>> virtual_alias_maps = unionmap:{sth1, sth2}
> >>>>> if:
> >>>>> `sth1' maps someone1 -> someone2
> >>>>> `sth2' maps someone2 -> someone1
> >>>>
> >>>> ERROR! Message not delivered due to recursion!
> >>>
> >>> You can do the exacts same with just one table:
> >>>
> >>>     a->b
> >>>     b->a
> >>>
> >>> will produce 'unreasonable virtual_alias_maps map nesting for a --
> >>> message not accepted, try again later'.
> >>
> >> Why in this case:
> >>
> >> `sth1': someone1 -> someone1,someone2
> >> `sth2': someone2 -> someone3
> >>
> >> someone3 receives the mail in two copies??
> >> (someone1 receives it once)
> >
> > Set "enable_original_recipient = no" if you don't want that, and
> > see http://www.postfix.org/postconf.5.html#enable_original_recipient
> > for why this rain damage exists.
>
> No, it has nothing to do. With both settings it works the same.
>
> Moreover:
>
> `sth1': someone1 -> someone1,someone2
> `sth2': someone2 -> someone2,someone3
>
> `someone1' receives one copy, `someone2' - two...  and `someone3' - three...

You forgot to 'postfix reload'
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Wietse Venema
In reply to this post by Marek Kozlowski-2
Marek Kozlowski:

> >>>> Why in this case:
> >>>>
> >>>> `sth1': someone1 -> someone1,someone2
> >>>> `sth2': someone2 -> someone3
> >>>>
> >>>> someone3 receives the mail in two copies??
> >>>> (someone1 receives it once)
> >>>
> >>> Set "enable_original_recipient = no" if you don't want that, and
> >>> see http://www.postfix.org/postconf.5.html#enable_original_recipient
> >>> for why this rain damage exists.
> >>
> >> No, it has nothing to do. With both settings it works the same.
> >>
> >> Moreover:
> >>
> >> `sth1': someone1 -> someone1,someone2
> >> `sth2': someone2 -> someone2,someone3
> >>
> >> `someone1' receives one copy, `someone2' - two...  and `someone3' - three...
> >
> > You forgot to 'postfix reload'
>
> Absolutely not.

With Postfix >= 2.2 and "enable_original_recipient = no", the cleanup
daemon deduplicates recipients OF THE SAME MESSAGE INSTANCE regardless
of whether the recipients are 'original' to the request, whether
the recipients are derived through virtual_alias_maps or canonical_maps,
or whether the recipients are added with always_bcc, sender_bcc_maps
or recipient_bcc_maps.

This is easy to verify by examining cleanup_out_recipient.c, which
is the only function that appends recipients to a queue file.

If that function doesn't deduplicate, then someone has 'improved'
the cleanup_out_recipient.c code, for which I take no responsibility.

I won't answer to follow-up unless they are concrete enough (includinbg
Postfix build information) that they can be verified independently.

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Marek Kozlowski-2
On 02/22/2017 03:31 PM, Wietse Venema wrote:

> Marek Kozlowski:
>>>>>> Why in this case:
>>>>>>
>>>>>> `sth1': someone1 -> someone1,someone2
>>>>>> `sth2': someone2 -> someone3
>>>>>>
>>>>>> someone3 receives the mail in two copies??
>>>>>> (someone1 receives it once)
>>>>>
>>>>> Set "enable_original_recipient = no" if you don't want that, and
>>>>> see http://www.postfix.org/postconf.5.html#enable_original_recipient
>>>>> for why this rain damage exists.
>>>>
>>>> No, it has nothing to do. With both settings it works the same.
>>>>
>>>> Moreover:
>>>>
>>>> `sth1': someone1 -> someone1,someone2
>>>> `sth2': someone2 -> someone2,someone3
>>>>
>>>> `someone1' receives one copy, `someone2' - two...  and `someone3' - three...
>>>
>>> You forgot to 'postfix reload'
>>
>> Absolutely not.
>
> With Postfix >= 2.2 and "enable_original_recipient = no", the cleanup
> daemon deduplicates recipients OF THE SAME MESSAGE INSTANCE regardless
> of whether the recipients are 'original' to the request, whether
> the recipients are derived through virtual_alias_maps or canonical_maps,
> or whether the recipients are added with always_bcc, sender_bcc_maps
> or recipient_bcc_maps.
>
> This is easy to verify by examining cleanup_out_recipient.c, which
> is the only function that appends recipients to a queue file.
>
> If that function doesn't deduplicate, then someone has 'improved'
> the cleanup_out_recipient.c code, for which I take no responsibility.
>
> I won't answer to follow-up unless they are concrete enough (includinbg
> Postfix build information) that they can be verified independently.
I don't think that someone modified the sources cause that is ArchLinux
which almost always fully relies on upstream; it never happens that they
"improve" nor modify the upstream stable code if it works.

I'm using the up-to-date version which is 3.1.4-1.

Ask for any parameters and I'll send them. I'm not sure how can I
display compile options or build parameters (do postconf does it?).

Best regards,
Marek



smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Marek Kozlowski-2
:-)

>> I won't answer to follow-up unless they are concrete enough (includinbg
>> Postfix build information) that they can be verified independently.
>
> I don't think that someone modified the sources cause that is ArchLinux
> which almost always fully relies on upstream; it never happens that they
> "improve" nor modify the upstream stable code if it works.

Sorry, stop, please. Don't debug it. May be affected by some other
factors. I'll check thoroughly and let you know.

Best regards,
Marek



smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: unionmap?

Marek Kozlowski-2
On 02/22/2017 03:49 PM, Marek Kozlowski wrote:

> :-)
>
>>> I won't answer to follow-up unless they are concrete enough (includinbg
>>> Postfix build information) that they can be verified independently.
>>
>> I don't think that someone modified the sources cause that is ArchLinux
>> which almost always fully relies on upstream; it never happens that they
>> "improve" nor modify the upstream stable code if it works.
>
> Sorry, stop, please. Don't debug it. May be affected by some other
> factors. I'll check thoroughly and let you know.
It was my fault. I've been using spamassassin directly that means it
re-injected mail back to a queue with sendmail. So virtual maps were
applied twice: before spamassassin and after it. With unionmaps in some
cases it may result in such multiplying recipient addresses...

Thank you Wietse!
Best regards,
Marek


smime.p7s (4K) Download Attachment
Loading...