limit/tune the smtp sender dameon for specific destination domains

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

limit/tune the smtp sender dameon for specific destination domains

David Touzeau
Dear

I would like to tune postfix smtp sender according specific destination domains eg number of connexions, number of email per seconds, queue life time

Is there any documentation on this needs or how can i define settings in order to achieve this task ?


Best regards
Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

mouss-4
Le 29/01/2011 22:19, David Touzeau a écrit :
> Dear
>
> I would like to tune postfix smtp sender according specific destination
> domains eg number of connexions, number of email per seconds, queue life
> time
>
> Is there any documentation on this needs or how can i define settings in
> order to achieve this task ?
>

clone the smtp transport in master.cf. for example:

slowsmtp      unix  -       -       n       -       -       smtp

foosmtp      unix  -       -       n       -       -       smtp

barsmtp      unix  -       -       n       -       -       smtp


then you can use

foosmtp_some_variable = some_value

Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

Ralf Hildebrandt
In reply to this post by David Touzeau
* David Touzeau <[hidden email]>:

> I would like to tune postfix smtp sender according specific destination
> domains eg number of connexions, number of email per seconds,

Mouss gave you the solution for these two

> queue life time

That's not possible with a single instance postfix. You'd need
multiple instances for that.

--
Ralf Hildebrandt
  Geschäftsbereich IT | Abteilung Netzwerk
  Charité - Universitätsmedizin Berlin
  Campus Benjamin Franklin
  Hindenburgdamm 30 | D-12203 Berlin
  Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
  [hidden email] | http://www.charite.de
           
Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

David Touzeau
In reply to this post by mouss-4
Le samedi 29 janvier 2011 à 22:23 +0100, mouss a écrit :

> Le 29/01/2011 22:19, David Touzeau a écrit :
> > Dear
> >
> > I would like to tune postfix smtp sender according specific destination
> > domains eg number of connexions, number of email per seconds, queue life
> > time
> >
> > Is there any documentation on this needs or how can i define settings in
> > order to achieve this task ?
> >
>
> clone the smtp transport in master.cf. for example:
>
> slowsmtp      unix  -       -       n       -       -       smtp
>
> foosmtp      unix  -       -       n       -       -       smtp
>
> barsmtp      unix  -       -       n       -       -       smtp
>
>
> then you can use
>
> foosmtp_some_variable = some_value


Many thanks Mouss, i will try in this way
>


Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

Steve Jenkins-3
In reply to this post by mouss-4
On Sat, Jan 29, 2011 at 1:23 PM, mouss <[hidden email]> wrote:

> Le 29/01/2011 22:19, David Touzeau a écrit :
>> Dear
>>
>> I would like to tune postfix smtp sender according specific destination
>> domains eg number of connexions, number of email per seconds, queue life
>> time
>>
>> Is there any documentation on this needs or how can i define settings in
>> order to achieve this task ?
>>
>
> clone the smtp transport in master.cf. for example:
>
> slowsmtp      unix  -       -       n       -       -       smtp
>
> foosmtp      unix  -       -       n       -       -       smtp
>
> barsmtp      unix  -       -       n       -       -       smtp
>
>
> then you can use
>
> foosmtp_some_variable = some_value

Ok - I read "man 5 master" to try and figure this out, but it still
didn't make sense.

So for example, let's say I wanted to limit outgoing mail to yahoo.com
to 10 simultaneous connections and 20 emails per second. In master.cf
I'm presuming I put:

yahoosmtp      unix  -       -       n       -       -       smtp

But then I didn't understand the "some_variable = some_value" part of
the solution. I'm assuming that part goes in main.cf, but beyond that
I'm stumped on how my "10" and "20" values get declared and
interpreted properly.

Thanks,

SteveJ
Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

mouss-4
Le 31/01/2011 00:09, Steve Jenkins a écrit :

> On Sat, Jan 29, 2011 at 1:23 PM, mouss <[hidden email]> wrote:
>> Le 29/01/2011 22:19, David Touzeau a écrit :
>>> Dear
>>>
>>> I would like to tune postfix smtp sender according specific destination
>>> domains eg number of connexions, number of email per seconds, queue life
>>> time
>>>
>>> Is there any documentation on this needs or how can i define settings in
>>> order to achieve this task ?
>>>
>>
>> clone the smtp transport in master.cf. for example:
>>
>> slowsmtp      unix  -       -       n       -       -       smtp
>>
>> foosmtp      unix  -       -       n       -       -       smtp
>>
>> barsmtp      unix  -       -       n       -       -       smtp
>>
>>
>> then you can use
>>
>> foosmtp_some_variable = some_value
>
> Ok - I read "man 5 master" to try and figure this out, but it still
> didn't make sense.

read for example:
http://www.postfix.org/postconf.5.html#default_destination_concurrency_limit

and look at the line that says: Use transport_...  if you look enough,
you'll notice that "transport" is in italics.

now you can read the postconf.5.html and look for all
default_destination_* variables.

so maybe some examples are easier to read?

foosmtp_destination_concurrency_limit = 10
foosmtp_destination_rate_delay = 1
foosmtp_destination_concurrency_failed_cohort_limit = 10

http://www.postfix.org/postconf.5.html#transport_destination_concurrency_failed_cohort_limit
http://www.postfix.org/postconf.5.html#transport_destination_rate_delay
http://www.postfix.org/postconf.5.html#default_destination_concurrency_limit

>
> So for example, let's say I wanted to limit outgoing mail to yahoo.com
> to 10 simultaneous connections and 20 emails per second. In master.cf
> I'm presuming I put:
>
> yahoosmtp      unix  -       -       n       -       -       smtp
>
> But then I didn't understand the "some_variable = some_value" part of
> the solution. I'm assuming that part goes in main.cf, but beyond that
> I'm stumped on how my "10" and "20" values get declared and
> interpreted properly.
>


see above, as well as
http://tech.groups.yahoo.com/group/postfix-users/message/234969




> Thanks,
>
> SteveJ

Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

Wietse Venema
In reply to this post by Steve Jenkins-3
Steve Jenkins:
> So for example, let's say I wanted to limit outgoing mail to yahoo.com
> to 10 simultaneous connections and 20 emails per second. In master.cf
> I'm presuming I put:
>
> yahoosmtp ? ? ?unix ?- ? ? ? - ? ? ? n ? ? ? - ? ? ? - ? ? ? smtp

To limit the concurrency to 10:

/etc/postfix/main.cf:
    yahoosmtp_destination_concurrency_limit = 10
    transport_maps = hash:/etc/postfix/transport

/etc/postfix/transport:
    yahoo.com yahoosmtp:

Details:
http://www.postfix.org/postconf.5.html#transport_destination_concurrency_limit
http://www.postfix.org/postconf.5.html#transport_maps

To limit the sending rate:

/etc/postfix/main.cf:
    yahoosmtp_rate_delay = 1
    transport_maps = hash:/etc/postfix/transport

/etc/postfix/transport:
    yahoo.com yahoosmtp:

The ..._destination_rate_delay feature always sends one message at
a time, and it does not support delays smaller than 1s. It is
primarily meant for home users and their ISP's usage policies.

Details:
http://www.postfix.org/postconf.5.html#transport_destination_rate_delay
http://www.postfix.org/postconf.5.html#transport_maps
http://www.postfix.org/postconf.5.html#transport_destination_recipient_limit

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

David Touzeau
In reply to this post by mouss-4
Le lundi 31 janvier 2011 à 00:50 +0100, mouss a écrit :
Le 31/01/2011 00:09, Steve Jenkins a écrit :
> On Sat, Jan 29, 2011 at 1:23 PM, mouss <[hidden email]> wrote:
>> Le 29/01/2011 22:19, David Touzeau a écrit :
>>> Dear
>>>
>>> I would like to tune postfix smtp sender according specific destination
>>> domains eg number of connexions, number of email per seconds, queue life
>>> time
>>>
>>> Is there any documentation on this needs or how can i define settings in
>>> order to achieve this task ?
>>>
>>
>> clone the smtp transport in master.cf. for example:
>>
>> slowsmtp      unix  -       -       n       -       -       smtp
>>
>> foosmtp      unix  -       -       n       -       -       smtp
>>
>> barsmtp      unix  -       -       n       -       -       smtp
>>
>>
>> then you can use
>>
>> foosmtp_some_variable = some_value
> 
> Ok - I read "man 5 master" to try and figure this out, but it still
> didn't make sense.

read for example:
http://www.postfix.org/postconf.5.html#default_destination_concurrency_limit

and look at the line that says: Use transport_...  if you look enough,
you'll notice that "transport" is in italics.

now you can read the postconf.5.html and look for all
default_destination_* variables.

so maybe some examples are easier to read?

foosmtp_destination_concurrency_limit = 10
foosmtp_destination_rate_delay = 1
foosmtp_destination_concurrency_failed_cohort_limit = 10

http://www.postfix.org/postconf.5.html#transport_destination_concurrency_failed_cohort_limit
http://www.postfix.org/postconf.5.html#transport_destination_rate_delay
http://www.postfix.org/postconf.5.html#default_destination_concurrency_limit

> 
> So for example, let's say I wanted to limit outgoing mail to yahoo.com
> to 10 simultaneous connections and 20 emails per second. In master.cf
> I'm presuming I put:
> 
> yahoosmtp      unix  -       -       n       -       -       smtp
> 
> But then I didn't understand the "some_variable = some_value" part of
> the solution. I'm assuming that part goes in main.cf, but beyond that
> I'm stumped on how my "10" and "20" values get declared and
> interpreted properly.
> 


see above, as well as
http://tech.groups.yahoo.com/group/postfix-users/message/234969




> Thanks,
> 
> SteveJ

Many Thanks !!!!


Is it supported to set parameters in command line directly in master cf eg ?

slowsmtp unix -     -     n     -     -     smtp -o transport_destination_concurrency_failed_cohort_limit=1 -o transport_delivery_slot_loan=2 -o transport_delivery_slot_discount=10 -o transport_delivery_slot_cost=2 ....



Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

Victor Duchovni
On Fri, Feb 04, 2011 at 12:52:05PM +0100, David Touzeau wrote:

> Is it supported to set parameters in command line directly in master cf
> eg ?

No.

>
> slowsmtp unix -     -     n     -     -     smtp

The above goes in master.cf with no "-o ..." options.

> transport_destination_concurrency_failed_cohort_limit=1
> transport_delivery_slot_loan=2 -o transport_delivery_slot_discount=10 -o
> transport_delivery_slot_cost=2 ....

No. In main.cf you put (say):

    slowsmtp_destination_concurrency_failed_cohort_limit=1

AND DO NOT ATTEMPT TO TUNE the below variables. Leave the defaults in
place.

    > slowsmtp_delivery_slot_loan=2
    > slowsmtp_delivery_slot_discount=10
    > slowsmtp_delivery_slot_cost=2 ....

The queue-manager algorithm for scheduling messages with few recipients
that arrive after messages with a large number of recipients can only
be understood by Hungarian logicians. :-) Everyone else marvels at the
clever design and does not tinker.

--
        Viktor.
Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

David Touzeau
Le vendredi 04 février 2011 à 14:16 -0500, Victor Duchovni a écrit :

> On Fri, Feb 04, 2011 at 12:52:05PM +0100, David Touzeau wrote:
>
> > Is it supported to set parameters in command line directly in master cf
> > eg ?
>
> No.
>
> >
> > slowsmtp unix -     -     n     -     -     smtp
>
> The above goes in master.cf with no "-o ..." options.
>
> > transport_destination_concurrency_failed_cohort_limit=1
> > transport_delivery_slot_loan=2 -o transport_delivery_slot_discount=10 -o
> > transport_delivery_slot_cost=2 ....
>
> No. In main.cf you put (say):
>
>     slowsmtp_destination_concurrency_failed_cohort_limit=1
>
> AND DO NOT ATTEMPT TO TUNE the below variables. Leave the defaults in
> place.
>
>     > slowsmtp_delivery_slot_loan=2
>     > slowsmtp_delivery_slot_discount=10
>     > slowsmtp_delivery_slot_cost=2 ....
>
> The queue-manager algorithm for scheduling messages with few recipients
> that arrive after messages with a large number of recipients can only
> be understood by Hungarian logicians. :-) Everyone else marvels at the
> clever design and does not tinker.
>

Sorry but this was just an example, i put these parameters only to
understand if it possible or not ...

You means that tuning smtp instance is not possible trough " -o"
commandline ?

SO this kind of settings is not correct ??

#
==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
#
==========================================================================
smtp inet n - n - - smtpd

slowsmtp     unix - - n - - smtp
 -o default_destination_concurrency_failed_cohort_limit=1
 -o default_delivery_slot_loan=3
 -o default_delivery_slot_discount=50
 -o default_delivery_slot_cost=5
 -o default_initial_destination_concurrency=5
 -o default_destination_recipient_limit=50
 -o default_destination_concurrency_limit=20
 -o default_destination_rate_delay=5s

slowsmtp2     unix - - n - - smtp
 -o default_destination_concurrency_failed_cohort_limit=1
 -o default_delivery_slot_loan=3
 -o default_delivery_slot_discount=50
 -o default_delivery_slot_cost=5
 -o default_initial_destination_concurrency=5
 -o default_destination_recipient_limit=50
 -o default_destination_concurrency_limit=20
 -o default_destination_rate_delay=0s




Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

Victor Duchovni
On Fri, Feb 04, 2011 at 08:31:31PM +0100, David Touzeau wrote:

> > > Is it supported to set parameters in command line directly in master cf
> > > eg ?
> >
> > No.

Not the parameters you showed, they are queue-manager parameters, not
SMTP client parameters.

> Sorry but this was just an example, i put these parameters only to
> understand if it possible or not ...

The parameters that are relevant to smtp(8) are specified in the smtp(8)
manpage:

    http://www.postfix.org/smtp.8.html

> You means that tuning smtp instance is not possible trough " -o"
> commandline ?

No, tuning queue-manager parameters is not possible through "-o"
overrides in the master.cf entry for smtp(8).

> SO this kind of settings is not correct ??
>
> #
> ==========================================================================
> # service type  private unpriv  chroot  wakeup  maxproc command + args
> #               (yes)   (yes)   (yes)   (never) (100)
> #
> ==========================================================================
> smtp inet n - n - - smtpd
>
> slowsmtp     unix - - n - - smtp
>  -o default_destination_concurrency_failed_cohort_limit=1
>  -o default_delivery_slot_loan=3
>  -o default_delivery_slot_discount=50
>  -o default_delivery_slot_cost=5
>  -o default_initial_destination_concurrency=5
>  -o default_destination_recipient_limit=50
>  -o default_destination_concurrency_limit=20
>  -o default_destination_rate_delay=5s

Indeed this is not correct. These are queue-manager parameters.

> slowsmtp2     unix - - n - - smtp
>  -o default_destination_concurrency_failed_cohort_limit=1
>  -o default_delivery_slot_loan=3
>  -o default_delivery_slot_discount=50
>  -o default_delivery_slot_cost=5
>  -o default_initial_destination_concurrency=5
>  -o default_destination_recipient_limit=50
>  -o default_destination_concurrency_limit=20
>  -o default_destination_rate_delay=0s

These overrides have no effect on smtp(8). And you are trying to change
parameters you really should not be changing.

If you can't explain how the "default_delivery_slot_<mumble>" variables
achieve your goals, you should not (attempt to) modify these parameters.

--
        Viktor.
Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

mouss-4
In reply to this post by David Touzeau
Le 04/02/2011 12:52, David Touzeau a écrit :

> Le lundi 31 janvier 2011 à 00:50 +0100, mouss a écrit :
>
>> Le 31/01/2011 00:09, Steve Jenkins a écrit :
>>> On Sat, Jan 29, 2011 at 1:23 PM, mouss <[hidden email]> wrote:
>>>> Le 29/01/2011 22:19, David Touzeau a écrit :
>>>>> Dear
>>>>>
>>>>> I would like to tune postfix smtp sender according specific destination
>>>>> domains eg number of connexions, number of email per seconds, queue life
>>>>> time
>>>>>
>>>>> Is there any documentation on this needs or how can i define settings in
>>>>> order to achieve this task ?
>>>>>
>>>>
>>>> clone the smtp transport in master.cf. for example:
>>>>
>>>> slowsmtp      unix  -       -       n       -       -       smtp
>>>>
>>>> foosmtp      unix  -       -       n       -       -       smtp
>>>>
>>>> barsmtp      unix  -       -       n       -       -       smtp
>>>>
>>>>
>>>> then you can use
>>>>
>>>> foosmtp_some_variable = some_value
>>>
>>> Ok - I read "man 5 master" to try and figure this out, but it still
>>> didn't make sense.
>>
>> read for example:
>> http://www.postfix.org/postconf.5.html#default_destination_concurrency_limit
>>
>> and look at the line that says: Use transport_...  if you look enough,
>> you'll notice that "transport" is in italics.
>>
>> now you can read the postconf.5.html and look for all
>> default_destination_* variables.
>>
>> so maybe some examples are easier to read?
>>
>> foosmtp_destination_concurrency_limit = 10
>> foosmtp_destination_rate_delay = 1
>> foosmtp_destination_concurrency_failed_cohort_limit = 10
>>
>> http://www.postfix.org/postconf.5.html#transport_destination_concurrency_failed_cohort_limit
>> http://www.postfix.org/postconf.5.html#transport_destination_rate_delay
>> http://www.postfix.org/postconf.5.html#default_destination_concurrency_limit
>>
>>>
>>> So for example, let's say I wanted to limit outgoing mail to yahoo.com
>>> to 10 simultaneous connections and 20 emails per second. In master.cf
>>> I'm presuming I put:
>>>
>>> yahoosmtp      unix  -       -       n       -       -       smtp
>>>
>>> But then I didn't understand the "some_variable = some_value" part of
>>> the solution. I'm assuming that part goes in main.cf, but beyond that
>>> I'm stumped on how my "10" and "20" values get declared and
>>> interpreted properly.
>>>
>>
>>
>> see above, as well as
>> http://tech.groups.yahoo.com/group/postfix-users/message/234969
>>
>>
>>
>>
>>> Thanks,
>>>
>>> SteveJ
>>
>
> Many Thanks !!!!
>
>
> Is it supported to set parameters in command line directly in master cf
> eg ?
>
> slowsmtp unix -     -     n     -     -     smtp -o
> transport_destination_concurrency_failed_cohort_limit=1 -o
> transport_delivery_slot_loan=2 -o transport_delivery_slot_discount=10 -o
> transport_delivery_slot_cost=2 ....
>

hmmm. my understanding is that you're working on a UI for postfix. but
then, you should avoid -o stuff in master.cf. even if you generate
master.cf.



Reply | Threaded
Open this post in threaded view
|

Re: limit/tune the smtp sender dameon for specific destination domains

David Touzeau
In reply to this post by Victor Duchovni
Le vendredi 04 février 2011 à 14:48 -0500, Victor Duchovni a écrit :

> On Fri, Feb 04, 2011 at 08:31:31PM +0100, David Touzeau wrote:
>
> > > > Is it supported to set parameters in command line directly in master cf
> > > > eg ?
> > >
> > > No.
>
> Not the parameters you showed, they are queue-manager parameters, not
> SMTP client parameters.
>
> > Sorry but this was just an example, i put these parameters only to
> > understand if it possible or not ...
>
> The parameters that are relevant to smtp(8) are specified in the smtp(8)
> manpage:
>
>     http://www.postfix.org/smtp.8.html
>
> > You means that tuning smtp instance is not possible trough " -o"
> > commandline ?
>
> No, tuning queue-manager parameters is not possible through "-o"
> overrides in the master.cf entry for smtp(8).
>
> > SO this kind of settings is not correct ??
> >
> > #
> > ==========================================================================
> > # service type  private unpriv  chroot  wakeup  maxproc command + args
> > #               (yes)   (yes)   (yes)   (never) (100)
> > #
> > ==========================================================================
> > smtp inet n - n - - smtpd
> >
> > slowsmtp     unix - - n - - smtp
> >  -o default_destination_concurrency_failed_cohort_limit=1
> >  -o default_delivery_slot_loan=3
> >  -o default_delivery_slot_discount=50
> >  -o default_delivery_slot_cost=5
> >  -o default_initial_destination_concurrency=5
> >  -o default_destination_recipient_limit=50
> >  -o default_destination_concurrency_limit=20
> >  -o default_destination_rate_delay=5s
>
> Indeed this is not correct. These are queue-manager parameters.
>
> > slowsmtp2     unix - - n - - smtp
> >  -o default_destination_concurrency_failed_cohort_limit=1
> >  -o default_delivery_slot_loan=3
> >  -o default_delivery_slot_discount=50
> >  -o default_delivery_slot_cost=5
> >  -o default_initial_destination_concurrency=5
> >  -o default_destination_recipient_limit=50
> >  -o default_destination_concurrency_limit=20
> >  -o default_destination_rate_delay=0s
>
> These overrides have no effect on smtp(8). And you are trying to change
> parameters you really should not be changing.
>
> If you can't explain how the "default_delivery_slot_<mumble>" variables
> achieve your goals, you should not (attempt to) modify these parameters.
>

Many thanks Victor

Your answered to my question and your are very right....