How do I throttle outbound email with sendmail

6,307

Solution 1

What version of Sendmail?

The short answer is you can't... at least not with the control and granularity most people would require/desire.

The more expanded answer is... you can... by limiting the daemon's children (confMAX_DAEMON_CHILDREN in sendmail.mc), but keep in mind that those children are used for both INCOMING and outgoing traffic.

You can also limit the number of queued messages processed every time the queue is run (confMAX_QUEUE_RUN... I think) but once again... its not a very granular/precise method.

I know I was able to successfully throttle sendmail in the past but I believe I had the luxury of doing it on a two-server system... one for inbound (left untouched) and one for outbound (configured the total connection rate).

One other thing you might try is to ignore sendmail completely and throttle the bandwidth at the server level. I know of a few sysadmins who have taken that approach.

Hope this helps.

Solution 2

Not sure how to do it in sendmail.

But I'd say you could do it on a host(MX) by host(MX) basis using iptables rate limiting. I've never used rate limiting in iptables, but I think it would do the trick. All the examples I've seen were for incoming connections, but I can't see why it should not work for outgoing.

This should work as long as the domain you want to throttle on does not share an MX host with a domain you care about.

Share:
6,307

Related videos on Youtube

kristenjo11
Author by

kristenjo11

Updated on September 17, 2022

Comments

  • kristenjo11
    kristenjo11 almost 2 years

    I know, I know, I should switch to Postfix. But in the meantime, how do I throttle outbound email (especially email to a single domain) in Sendmail?

  • Mike Castro Demaria
    Mike Castro Demaria almost 10 years
    -1 : more an open thinking than an aswer, it's bettre to put it in comment of the first answer and give a link of a simimlar iptable case.