Policy-based aliases

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

Policy-based aliases

Pavel Bychikhin
Dear Community,

I need Policy-based aliases - the aliases that would be different for
different sender/recipient pairs.

For example if [hidden email] writes to [hidden email], the
recipient address will expand to [hidden email] and [hidden email].

But if [hidden email] writes to [hidden email], the
recipient address will expand to [hidden email] and [hidden email].

Is it possible in Postfix? If so, how to implement in most efficient way?

So far I see two options: REDIRECT and dedicated smtp daemon with
different alias settings as a FILTER.

Both options have pros and cons. Which one is better? Or maybe there is
something even better that these two?

Thanks in advance


--
Best regards,
Pavel

Reply | Threaded
Open this post in threaded view
|

Re: Policy-based aliases

Wietse Venema
Pavel Bychikhin:

> Dear Community,
>
> I need Policy-based aliases - the aliases that would be different for
> different sender/recipient pairs.
>
> For example if [hidden email] writes to [hidden email], the
> recipient address will expand to [hidden email] and [hidden email].
>
> But if [hidden email] writes to [hidden email], the
> recipient address will expand to [hidden email] and [hidden email].
>
> Is it possible in Postfix? If so, how to implement in most efficient way?

This can be done with a Milter program. Milters can add or replace
recipients (and modify the message). Milters can be implemented in
a variety of languages including C, Python and Perl. Its's better
than having some non-standard Postfix-specific built-in programming
language,

> So far I see two options: REDIRECT and dedicated smtp daemon with
> different alias settings as a FILTER.

REDIRECT overrides ALL recipients, which may or may not be a problem.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Policy-based aliases

Pavel Bychikhin
Wietse,

I understand that REDIRECT is not by far the best option.

What if I add another smtpd daemon to master.cf with different
"virtual_alias_maps" parameter, and FILTER mails that match the policy
to than new daemon for final delivery?

Will it work or because there is only one cleanup daemon, only one set
of aliases will be used anyways?

Thank you

Best regards,
Pavel

On 11/24/2017 9:20 PM, Wietse Venema wrote:

> Pavel Bychikhin:
>> Dear Community,
>>
>> I need Policy-based aliases - the aliases that would be different for
>> different sender/recipient pairs.
>>
>> For example if [hidden email] writes to [hidden email], the
>> recipient address will expand to [hidden email] and [hidden email].
>>
>> But if [hidden email] writes to [hidden email], the
>> recipient address will expand to [hidden email] and [hidden email].
>>
>> Is it possible in Postfix? If so, how to implement in most efficient way?
> This can be done with a Milter program. Milters can add or replace
> recipients (and modify the message). Milters can be implemented in
> a variety of languages including C, Python and Perl. Its's better
> than having some non-standard Postfix-specific built-in programming
> language,
>
>> So far I see two options: REDIRECT and dedicated smtp daemon with
>> different alias settings as a FILTER.
> REDIRECT overrides ALL recipients, which may or may not be a problem.
>
> Wietse

Reply | Threaded
Open this post in threaded view
|

Re: Policy-based aliases

Wietse Venema
Pavel Bychikhin:

> Wietse,
>
> I understand that REDIRECT is not by far the best option.
>
> What if I add another smtpd daemon to master.cf with different
> "virtual_alias_maps" parameter, and FILTER mails that match the policy
> to than new daemon for final delivery?
>
> Will it work or because there is only one cleanup daemon, only one set
> of aliases will be used anyways?
>
> Thank you
>
> Best regards,
> Pavel
>
> On 11/24/2017 9:20 PM, Wietse Venema wrote:
> > Pavel Bychikhin:
> >> Dear Community,
> >>
> >> I need Policy-based aliases - the aliases that would be different for
> >> different sender/recipient pairs.
> >>
> >> For example if [hidden email] writes to [hidden email], the
> >> recipient address will expand to [hidden email] and [hidden email].
> >>
> >> But if [hidden email] writes to [hidden email], the
> >> recipient address will expand to [hidden email] and [hidden email].
> >>
> >> Is it possible in Postfix? If so, how to implement in most efficient way?
> > This can be done with a Milter program. Milters can add or replace
> > recipients (and modify the message). Milters can be implemented in
> > a variety of languages including C, Python and Perl. Its's better
> > than having some non-standard Postfix-specific built-in programming
> > language,
> >
> >> So far I see two options: REDIRECT and dedicated smtp daemon with
> >> different alias settings as a FILTER.
> > REDIRECT overrides ALL recipients, which may or may not be a problem.
>

I recommend that you use a Milter and delete/add recipients
as appropriate.

Sorry, I will not attempt to prescribe a FILTER-based solution.
There is not enough time in the day.

        Wietse