1

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.

  • 1
    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
  • 2
    @SandorMarton you mean 6mail/minute don't you? – NickW May 10 '13 at 14:31
  • 1
    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
1

If your submitters are all external to the server (they are not sending from the localhost) you could do a few different things, something like policyd might be apropos, especially if the users are sending from outside, and you are using SASL (not necessary, but it makes user identification much more secure). It has some options like Access Control, but above all, quotas which can bet set by user, domain, or for the entire server..

| improve this answer | |
  • Thanks for the info. However in this case the emails are submitted locally to the postfix mailq by software on the server and sent out using psotfix – dgibbs May 10 '13 at 16:01
  • Man, that's not a pleasant situation to have to deal with. Good luck. – NickW May 10 '13 at 16:03
  • I will investigate policyd as it might do what I need. Thanks – dgibbs May 14 '13 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.