Quantcast

Something like `flags_final' ?

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

Something like `flags_final' ?

Marek Kozlowski-2
:-)

I'm wondering if it is possible for two parameters, let's say (not
particularly those, generally):

sender_canonical_maps = sth1, sth2, sth3
recipient_canonical_maps = sth4, sth5, sth6

(`sth' is any source, it doesn't matter I hope) to force the following
behavor:

1. For `sender_canonical_maps' processing all three tables sequentially
2. For `recipient_canonical_maps' processing the tables until the first
matching entry is found; if found in let's say `sth5' then `sth6' will
be ignored.

That is: `sender_canonical_maps' allows several rewrites for a single
entry while `recipient_canonical_maps' only one (the very first found).

??

Best regards,
Marek


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

Re: Something like `flags_final' ?

Marek Kozlowski-2
On 02/15/2017 02:04 PM, Marek Kozlowski wrote:

> :-)
>
> I'm wondering if it is possible for two parameters, let's say (not
> particularly those, generally):
>
> sender_canonical_maps = sth1, sth2, sth3
> recipient_canonical_maps = sth4, sth5, sth6
>
> (`sth' is any source, it doesn't matter I hope) to force the following
> behavor:
>
> 1. For `sender_canonical_maps' processing all three tables sequentially
> 2. For `recipient_canonical_maps' processing the tables until the first
> matching entry is found; if found in let's say `sth5' then `sth6' will
> be ignored.
>
> That is: `sender_canonical_maps' allows several rewrites for a single
> entry while `recipient_canonical_maps' only one (the very first found).
One more question:

Is it possible to apply different `sender_canonical_classes' for sth1,
sth2 and sth3 respectively?

Best ragrads,
Marek



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

Re: Something like `flags_final' ?

Noel Jones-2
On 2/15/2017 7:18 AM, Marek Kozlowski wrote:

>>
>> That is: `sender_canonical_maps' allows several rewrites for a single
>> entry while `recipient_canonical_maps' only one (the very first found).
>
> One more question:
>
> Is it possible to apply different `sender_canonical_classes' for sth1,
> sth2 and sth3 respectively?
>
> Best ragrads,
> Marek
>
>


Sorry, postfix doesn't support that level of map control.  The
lookup sequence is documented and not user-configurable.



  -- Noel Jones
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Something like `flags_final' ?

Marek Kozlowski-2
On 02/15/2017 04:26 PM, Noel Jones wrote:

> On 2/15/2017 7:18 AM, Marek Kozlowski wrote:
>>>
>>> That is: `sender_canonical_maps' allows several rewrites for a single
>>> entry while `recipient_canonical_maps' only one (the very first found).
>>
>> One more question:
>>
>> Is it possible to apply different `sender_canonical_classes' for sth1,
>> sth2 and sth3 respectively?
>
>
> Sorry, postfix doesn't support that level of map control.  The
> lookup sequence is documented and not user-configurable.
I need canonical for rewriting senders' addresses (both: "MAIL FROM:"
and "from:" to completely different ones and I decided to add postsrsd.
But I don't want postsrsd to manipulate "from:" header fields. How can I
achieve it?

BEst regards,
Marek



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

Re: Something like `flags_final' ?

Noel Jones-2
On 2/15/2017 10:00 AM, Marek Kozlowski wrote:

> I need canonical for rewriting senders' addresses (both: "MAIL FROM:"
> and "from:" to completely different ones and I decided to add postsrsd.
> But I don't want postsrsd to manipulate "from:" header fields. How can I
> achieve it?

That would need to be handled in postsrsd, and outside the scope of
this list. Perhaps one of the support channels for postsrsd can help.



  -- Noel Jones
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Something like `flags_final' ?

Mickaël DEQUIDT
In reply to this post by Marek Kozlowski-2


Le 15/02/2017 à 17:00, Marek Kozlowski a écrit :
> But I don't want postsrsd to manipulate "from:" header fields. How can I
> achieve it?

I believe setting :

sender_canonical_classes = envelope_sender

should do the trick : as long as you don't specify "header_sender" in
sender_canonical_classes, no reason for postsrsd to meddle with it.

Of course, this supposes that you have set sender_canonical_maps to the
right value.


--
Mickaël DEQUIDT


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

Re: Something like `flags_final' ?

Marek Kozlowski-2
On 02/15/2017 05:07 PM, Mickaël DEQUIDT wrote:

>
> Le 15/02/2017 à 17:00, Marek Kozlowski a écrit :
>> But I don't want postsrsd to manipulate "from:" header fields. How can I
>> achieve it?
>
> I believe setting :
>
> sender_canonical_classes = envelope_sender
>
> should do the trick : as long as you don't specify "header_sender" in
> sender_canonical_classes, no reason for postsrsd to meddle with it.
But note I wrote:

``I need canonical for rewriting senders' addresses (both: "MAIL FROM:"
and "from:" to completely different" ones)''

The problem is that first I use canonical for replacing both sender
addresses with some different ones and that time I need:

        sender_canonical_classes = envelope_sender, header_sender

But after that postsrsd if used for forward protection against SPF and
that time `sender_canonical_classes' should apply only to envelopes (as
in your example). That's the problem...

Best regards,
Marek





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

Re: Something like `flags_final' ?

Marek Kozlowski-2
In reply to this post by Marek Kozlowski-2
On 02/15/2017 02:18 PM, Marek Kozlowski wrote:
> On 02/15/2017 02:04 PM, Marek Kozlowski wrote:
>> sender_canonical_maps = sth1, sth2, sth3
>
> One more question:
>
> Is it possible to apply different `sender_canonical_classes' for sth1,
> sth2 and sth3 respectively?

OK, I'll explain it more thorough. The problem is:

I have two mail servers: let's say: A and B. For some reasons a few A
mail accounts have been moved to the B server (moreover: with different
user names) but I'd like to keep that change transparent. For this
reason there are virtuals on A redirecting incoming mail for those users
to the B server and canonicals on B rewriting sender addresses for
outgoing mail from those users to their official A-type addresses. Of
course: most client programs show `from:' rather than envelopes so at
this point canonical needs to rewrite both.

But those users are allowed to forward their mail to their external (for
example: Gmail) accounts. Gmail uses SPF checks so I have to use
postsrsd for adding SRS entries to envelope addresses. I don
t want postsrsd to modify `from:' fields because it has nothing to do
with SPF and those fields are visible in client programs and should be
"clean".

The problem is that postsrsd from the postfix perspective acts as a yet
another canonical lookup table so the same `sender_canonical_classes'
apply to it and the normal canonical described above...

Best regards,
Marek



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

Re: Something like `flags_final' ?

Noel Jones-2
On 2/15/2017 11:13 AM, Marek Kozlowski wrote:

> On 02/15/2017 02:18 PM, Marek Kozlowski wrote:
>> On 02/15/2017 02:04 PM, Marek Kozlowski wrote:
>>> sender_canonical_maps = sth1, sth2, sth3
>>
>> One more question:
>>
>> Is it possible to apply different `sender_canonical_classes' for sth1,
>> sth2 and sth3 respectively?
>
> OK, I'll explain it more thorough. The problem is:

Postfix built-in address rewriting is based on fairly simple
key|result tables, and isn't designed for conditional processing.

Postfix provides several plugin interfaces for external processing
such as milter, proxy, or content filters.  Perhaps one of these
interfaces can provide the extra functions you need.


  -- Noel Jones




>
> I have two mail servers: let's say: A and B. For some reasons a few A
> mail accounts have been moved to the B server (moreover: with different
> user names) but I'd like to keep that change transparent. For this
> reason there are virtuals on A redirecting incoming mail for those users
> to the B server and canonicals on B rewriting sender addresses for
> outgoing mail from those users to their official A-type addresses. Of
> course: most client programs show `from:' rather than envelopes so at
> this point canonical needs to rewrite both.
>
> But those users are allowed to forward their mail to their external (for
> example: Gmail) accounts. Gmail uses SPF checks so I have to use
> postsrsd for adding SRS entries to envelope addresses. I don
> t want postsrsd to modify `from:' fields because it has nothing to do
> with SPF and those fields are visible in client programs and should be
> "clean".
>
> The problem is that postsrsd from the postfix perspective acts as a yet
> another canonical lookup table so the same `sender_canonical_classes'
> apply to it and the normal canonical described above...
>
> Best regards,
> Marek
>
>

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

Re: Something like `flags_final' ?

Viktor Dukhovni
In reply to this post by Marek Kozlowski-2
On Wed, Feb 15, 2017 at 02:04:55PM +0100, Marek Kozlowski wrote:

> I'm wondering if it is possible for two parameters, let's say (not
> particularly those, generally):
>
> sender_canonical_maps = sth1, sth2, sth3
> recipient_canonical_maps = sth4, sth5, sth6
>
> 1. For `sender_canonical_maps' processing all three tables sequentially

    http://www.postfix.org/DATABASE_README.html

         pipemap (read-only)
             A pipeline of lookup tables. Example: "pipemap:{type1:name1,
             ..., typen:namen}". Each "pipemap:" query is given to the
             first table. Each lookup result becomes the query for the
             next table in the pipeline, and the last table produces
             the final result. When any table lookup produces no result,
             the pipeline produces no result. The first and last
             characters of the "pipemap:" table name must be "{" and
             "}". Within these, individual maps are separated with
             comma or whitespace.

DO NOT fail to notice, that each of the tables MUST produce a
result, a non-match in any table causes the entire pipeline to
return nothing, rather than just the last matching result.

    There's also:

         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.

It would not be too difficult to add a cascade table type that
returns the last matching result, but no such thing is available
at present.

> 2. For `recipient_canonical_maps' processing the tables until the first
> matching entry is found; if found in let's say `sth5' then `sth6' will
> be ignored.

This is normal processing of a list of tables.

--
        Viktor.
Loading...