Quantcast

Different LMTP configuration for different clients

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

Different LMTP configuration for different clients

Angel L. Mateo
Hello,

        I have a postfix mail relay server for my domain. This mail server
delivered mail to my imap server via LMTP.

        Now I want that all mail received from a client to the same imap
server, but with a different LMTP configuration. That is because this
client is a massive mailer and I want to deliver its mail with low
concurrency (I don't mind getting higher delays).

        Is this possible without deploying a new postfix server?

--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Different LMTP configuration for different clients

Wietse Venema
Angel L. Mateo:

> Hello,
>
> I have a postfix mail relay server for my domain. This mail server
> delivered mail to my imap server via LMTP.
>
> Now I want that all mail received from a client to the same imap
> server, but with a different LMTP configuration. That is because this
> client is a massive mailer and I want to deliver its mail with low
> concurrency (I don't mind getting higher delays).
>
> Is this possible without deploying a new postfix server?

Yes, with a transport map that resolves the recipient to an LMTP
service with a different (master.cf) name, for example slow_lmtp,
plus a main.cf setting for slow_lmtp_destination_concurrency_limit.

http://www.postfix.org/transport.5.html
http://www.postfix.org/master.5.html
http://www.postfix.org/postconf.5.html#transport_destination_concurrency_limit

Note that setting the limit to '1' may increase concurrency.

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

Re: Different LMTP configuration for different clients

Viktor Dukhovni
In reply to this post by Angel L. Mateo

> On May 3, 2017, at 7:56 AM, Angel L. Mateo <[hidden email]> wrote:
>
> I have a postfix mail relay server for my domain. This mail server delivered mail to my imap server via LMTP.
>
> Now I want that all mail received from a client to the same imap server, but with a different LMTP configuration. That is because this client is a massive mailer and I want to deliver its mail with low concurrency (I don't mind getting higher delays).
>
> Is this possible without deploying a new postfix server?

The answer depends on information you have not provided.

* How is this client distinguished from other clients?
* How big (message count) are the mail "bursts" from this sender?
* At what rate are messages arriving during a "burst"?
* How many such bursts a day?

When you slow down mail delivery below the burst arrival rate, a backlog
develops somewhere along the pipeline.  Depending on the size of the bursts,
the choice of the right place to buffer the bursts may change.

--
        Viktor.

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

Re: Different LMTP configuration for different clients

Angel L. Mateo
El 03/05/17 a las 16:44, Viktor Dukhovni escribió:

>
>> On May 3, 2017, at 7:56 AM, Angel L. Mateo <[hidden email]> wrote:
>>
>> I have a postfix mail relay server for my domain. This mail server delivered mail to my imap server via LMTP.
>>
>> Now I want that all mail received from a client to the same imap server, but with a different LMTP configuration. That is because this client is a massive mailer and I want to deliver its mail with low concurrency (I don't mind getting higher delays).
>>
>> Is this possible without deploying a new postfix server?
>
> The answer depends on information you have not provided.
>
> * How is this client distinguished from other clients?

        By IP

> * How big (message count) are the mail "bursts" from this sender?

        Thousand of mails (10k-30k), all directed to my own domain.

> * At what rate are messages arriving during a "burst"?

        I don't know. The only limitation we have in the postfix receiving
these mails are:

smtpd_client_connection_count_limit = 5
smtpd_client_connection_rate_limit = 100
smtpd_client_message_rate_limit = 500
smtpd_recipient_limit = 150

        My problem is not in the postfix side, but delivering to the IMAP
server. Because these bursts are of messages directed all of them to my
domain, when I receive one I have problems delivering them to the imap
server via LMTP.

> * How many such bursts a day?

        Depends, but it is not rare days with 2 or 3 bursts
>
> When you slow down mail delivery below the burst arrival rate, a backlog
> develops somewhere along the pipeline.  Depending on the size of the bursts,
> the choice of the right place to buffer the bursts may change.
>

--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Different LMTP configuration for different clients

Angel L. Mateo
In reply to this post by Wietse Venema
El 03/05/17 a las 16:40, Wietse Venema escribió:

> Angel L. Mateo:
>> Hello,
>>
>> I have a postfix mail relay server for my domain. This mail server
>> delivered mail to my imap server via LMTP.
>>
>> Now I want that all mail received from a client to the same imap
>> server, but with a different LMTP configuration. That is because this
>> client is a massive mailer and I want to deliver its mail with low
>> concurrency (I don't mind getting higher delays).
>>
>> Is this possible without deploying a new postfix server?
>
> Yes, with a transport map that resolves the recipient to an LMTP
> service with a different (master.cf) name, for example slow_lmtp,
> plus a main.cf setting for slow_lmtp_destination_concurrency_limit.
>
        My problem is that I can't classify by recipient. I should do it by
client IP. Is this possible in a transport map?

--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Different LMTP configuration for different clients

Peter Ajamian
On 04/05/17 18:13, Angel L. Mateo wrote:
>     My problem is that I can't classify by recipient. I should do it by
> client IP. Is this possible in a transport map?

No, instead use smtpd_client_restrictions with check_client_access and a
FILTER result pointing to the correct transport.  See postconf(5) and
access(5) for details.


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

Re: Different LMTP configuration for different clients

Angel L. Mateo
El 06/05/17 a las 03:12, Peter escribió:
> On 04/05/17 18:13, Angel L. Mateo wrote:
>>     My problem is that I can't classify by recipient. I should do it by
>> client IP. Is this possible in a transport map?
>
> No, instead use smtpd_client_restrictions with check_client_access and a
> FILTER result pointing to the correct transport.  See postconf(5) and
> access(5) for details.
>
        I have the first problem solved: I have created a restriction class
that apply a check_recipient_access just to the client I want with slow
delivery.

        My problem now is that I have this in the check_recipient_access:

/@mydomain\.com$/ FILTER slow_lmtp:[imapserver.mydomain.com]
/.+/ OK

        and now, as a side effect, amavis is not run for messages directed to
my domain from these clients.

        Is there any way to specify a content_filter for this kind of messages?

--
Angel L. Mateo Martínez
Sección de Telemática
Área de Tecnologías de la Información
y las Comunicaciones Aplicadas (ATICA)
http://www.um.es/atica
Tfo: 868889150
Fax: 868888337
Loading...