From: ram on

On Fri, 2010-04-09 at 15:03 +0400, Vladimir Vassiliev wrote:
> Hi postfixers,
>
> thanks to http://www.postfix.org/QSHAPE_README.html I learned how to
> limit rate of sending messages which arrives via smtpd.
> Now I tries to do the same with locally originating (via sendmail)
> messages. It seems usual recipes doesn't work.
> What are the best practices to do this? Several postfix instances or
> something else?
>
>
>


Usually applications that submit mail on commandline are not designed to
handle ratelimits and queue messages for throttled delivery. In fact
IMHO you should *not* try to build the intelligence of queue-ing and
trying later when postfix already does that so elegantly.

It will be best to run two instances on postfix, the first instance
picks up all the messages from the apps and send it at whatever rates
you find reasonable to the second "delivery" instance of postfix.

You could use different rates for different senders too based on the
envelope-from address


Thanks
Ram

From: Wietse Venema on
Vladimir Vassiliev:
>
> Ok, I was not clear with my first message
> Here is my config:
>
> main.cf:
> smtpd_recipient_restrictions = check_policy_service unix:private/policy
>
> permit_mynetworks,
>
> reject_unauth_destination
>
> master.cf:
> slow_smtp unix - - n - 3 smtp
>
> -o fallback_relay=[real_relay]
>
> -o smtp_connect_timeout=1
>
> -o smtp_connection_cache_on_demand=no
>
> Policy server returns "filter slow_smtp:[dead.host]" for specific
> messages (currently selection base on sender and recipient but later
> I'll try also size).
> This recipe works perfectly for messages arriving via smtp, and question
> is how it's possible to do the same for sendmail-arriving ones?

Use the Postfix 2.7 sender_dependent_default_transport_maps feature
to specify the mapping from sender address to "slow".

Wietse
>
> 09.04.2010 16:41, Wietse Venema ?????:
> > Vladimir Vassiliev:
> >>
> >> I need sender based selection
> >
> > You wrote that you learned from QSHAPE_REAME how to limit the rate
> > of sending messages which arrives via smtpd.
> >
> > QSHAPE_REAME does not cover sender-dependent selection; and I
> > already mentioned that its solutions to limit the sending rate
> > limit are independent of how mail was received.
> >
> > That said, Postfix 2.7 has sender_dependent_default_transport_maps
> > to override the default_transport setting, again, in a manner that
> > does not depend on how mail was received.
> >
> > Wietse
>
>
> --
> Vladimir Vassiliev
>
>