qmail-channels: throttle outbound delivery queues by domains

Do you have a large subscriber/bulk mail list and wish you could maintain different outbound queues by domain and throttle each queue at their own separate pace? Ever experience a certain ISP (like yahoo.com) bogging down and slowing the rest of your deliveries - wish you could sequester those deliveries to their own queue to run independently while the rest of your email gets delivered?

The qmail-channels patch allows you to add an arbitrary number of supplemental remote queues, each distinguished by a list of recipient domains and separate throttling (concurrency) capabilities. This patch also allows dynamic throttling of the concurrency control files so you can just send qmail-send a HUP signal instead of restarting the service every time (but see CAVEATS section of CHANNELS)

Patches

Patch for stock qmail-1.03: qmail-1.03-channels.patch
Patch for netqmail-1.06 (may also be applied against netqmail-1.05): netqmail-1.06-channels.patch
This patch may be applied with netqmail-1.06 (or netqmail-1.05) against the silly qmail syndrome (ext_todo) patchnetqmail-1.06-exttodo-channels.patch

Quick Howto

  1. Apply patch(es).
  2. Edit conf-channels: this must be at least 2 for the standard "local" and "remote" queues, any number greater than 2 will be added as optional, remote supplemental channels.
  3. Build.
  4. Create as many control/supplsX and corresponding control/concurrencysupplX files as you need where X is an integer starting at 0 to (conf-channels - 3) - refer man 8 qmail-send for more details.
  5. Start qmail.
  6. Send qmail-send a HUP signal after editing any of the above control files (including concurrencyremote and concurrencylocal) on the fly (but see CAVEATS section of CHANNELS).

Example: The following configuration will create separate queues for yahoo (supplemental channel 0), Comcast, AOL, MSN/Hotmail and so on, each with a concurrency of 100. The default "remote" channel will handle all other remote recipient domains not listed in the supplemental queues and will have a concurrency limit of 200.

To achieve throttling, for instance to throttle back AOL deliveries by half the rate set concurrencysuppl2 to 50 (and send a SIGHUP to qmail-send).

$ head control/suppls* control/concurrencysuppl* control/conncurrencyremote
==> suppls0 <==
yahoo.com

==> suppls1 <==
comcast.com
comcast.net

==> suppls2 <==
aol.com

==> suppls3 <==
msn.com
hotmail.com

==> suppls4 <==
gmail.com

==> concurrencysuppl0 <==
100

==> concurrencysuppl1 <==
100

==> concurrencysuppl2 <==
100

==> concurrencysuppl3 <==
100

==> concurrencysuppl4 <==
100

==> concurrencyremote <==
200