# Postfix rate limiting entire server

I have searched around for a good answer to my question but have yet to find one.

I deal with lots of Linux servers that send out newsletters. These servers are normally located at an office with a standard broadband connection. Sometimes a customer will send a newsletter with an attachment that may be a few MB in size. We do advise not to do this but they still so anyway.

What I am trying to achieve it a rate limit for postfix so it can only send out a small number of emails at any one time. By default postfix sends out loads in one go causing most to timeout half way though wasting loads of bandwidth. However sending just a few at a time will allow the emails to slowly flow out without saturating the connection and most emails failing to send. Most answers I have seen involve things like:

initial_destination_concurrency
default_destination_concurrency_limit
smtp_destination_concurrency_limit


However this applies to individual domains only and is not applied across the board.

I have however found this setting today

default_process_limit


It looks like it does what I need by limiting the amount of smtpd daemons that can spawn allowing X amount of emails to leave. My question would be is this the best course of action and also does default_process_limit effect inbound connections as well? as I am worried changing this could stop servers receiving emails if all smtpd daemons are being used.

Thank you

edit: all emails are submitted locally on the the server that are sending the emails.

• smtpd daemons are for receiving the mail. you could try smtp_destination_rate_delay, for ex smtp_destination_rate_delay=10s , meaning keep 10sec pause between each mail, so the output will be something like 6mail/sec . – Sandor Marton May 10 '13 at 14:30
• @SandorMarton you mean 6mail/minute don't you? – NickW May 10 '13 at 14:31
• Yes, 6mail/min, sorry. And that is not exact , since sending a mail could take multiple seconds/minute. – Sandor Marton May 10 '13 at 15:02
• smtpd is also for sending I can confirm this with a test I have done today. The server I using to test is for sending only and it is spawning smtpd daemons and has reduced the rate in which emails are leaving when setting default_process_limit = 5. See the tuning readme for info postfix.org/TUNING_README.html I will take a look at smtp_destination_rate_delay to see if this will work for me. Thanks – dgibbs May 10 '13 at 15:58
• smtpd is for receiving. Could play a role if the mail's (originating from the server) are submitted via 127.0.0.1:25 and not via sendmail; or if you have a content scanner (amavis ) which injects back the mail's via a smtpd listening on a non 25 port. Its a wrong approach to try to limit the rate with process limiting. – Sandor Marton May 10 '13 at 16:07