On 10/18/2016 3:39 AM, David Byrne wrote: > Hi all, > We need a way to limit outbound mails to a specific domain to just 10 mails > in 10minutes. The issue I’m having is that I can only get it to send 1 email > every queue run, so 1 email every 10minutes. I can set the > destionation_rate_delay to 1minute, and have 10 of them send in 10minutes, > but this delays the messages for up to 10 minutes. >
Postfix does not have a mechanism to send a burst of mail, then wait some specified period of time for the next burst. For a limit of 10 messages per 10 minutes, postfix must send one message per minute. The concurrency limit is automatically set to one when using rate delays. -- Noel Jones > I have a custom smtp_transport configured in a test environment: > > Running postfix 2.6.6 > CentOS 6.8 x64 > > Main.cf > #ratelimit config > smtp-dave_destination_rate_delay = 30s > smtp-dave_destination_concurrency_limit = 1 > smtp-dave_destination_recipient_limit = 2 > smtp-dave_initial_destination_concurrency = 1 > > #transport map > transport_maps = regexp:/etc/postfix/transport > > In /etc/postfix/transport I have: > /\@domain\.co\.uk/ smtp-dave: > (where domain is the receiving domain that this needs to apply to) > > Master.cf > smtp-dave unix - - n - 1 smtp > -o syslog_name=smtp-dave > > ----------------------------- > > I trigger a bunch of emails to be sent instantly with the following: > for i in `cat recpts`; do echo "hello" | mail -s "testing throttling" $i; done > (where recpts is a file with 60instances of the receiving domains email > address) > > What happens taking the above config into account is it queues 59 mails, > sends one, then runs the transport every 30seconds, and sends 1 more mail, > waits 30seconds, sends 1 more mail. > > There are two problems with this: > > Firstly, if I change the config to: > smtp-dave_destination_rate_delay = 30s > smtp-dave_destination_concurrency_limit = 5 > smtp-dave_destination_recipient_limit = 2 > smtp-dave_initial_destination_concurrency = 5 > > It does not send 5 emails at once, which I expected it to.. Perhaps I’ve > misinterpreted the meaning od concurrency limit?