public marks

PUBLIC MARKS from camel with tags mail & bandwidth

22 August 2008 08:45

Throttling qmail SMTP receive bandwidth | www.enchantedage.com

I wrote the program "throttle.c," which you can insert into the tcpserver chain of commands for a qmail smtpd server. It takes one argument: the number of kilobytes per second to let through on the incoming file descriptor. Throttle does not throttle the outgoing file descriptor, because that's usually just status from your mail server. Additionally, throttle will set an alarm, so that any session longer than 15 minutes will expire and disconnect. This affords some amount of protection against lingering sessions that eat up your parallelism limit; I've seen such sessions from presumably trojaned DSL machines connecting to the mail server to send spam.