Skip to content
Module 4 · Lesson 9 of 25

Traffic shaping with throttles

Part of KumoMTA: High-Volume Sending Engine, in the Queues, Scheduling & Traffic Shaping module.

Author

Beyond queue defaults, KumoMTA's shaping module is where you encode per-destination wisdom (Gmail wants 250/sec from a warm IP, Yahoo wants 100/sec, AOL is finicky on Sundays).

Use the bundled shaping library:

local shaping = require 'policy-extras.shaping'

kumo.on('get_egress_path_config', shaping:setup({'/opt/kumomta/etc/policy/shaping.toml'}))

shaping.toml snippet:

["gmail.com"]
connection_limit = 20
max_connection_rate = "20/s"
max_message_rate = "250/s"
idle_timeout = "60s"

["yahoo.com"]
connection_limit = 10
max_message_rate = "100/s"

["*.protection.outlook.com"]
connection_limit = 4
max_message_rate = "40/s"

Why TOML for shaping but Lua for everything else? Shaping changes often (especially during IP warming) and TOML is operator-friendly. Hot-reload with kcli reload; no restart needed.

KumoMTA community ships a maintained shaping.toml with sane defaults for the top 50 destinations. Use it as your baseline.

Sign in to keep track of what you have read.

Pulse · email sending

Sending infrastructure that is yours alone.

Every domain gets its own MX host, IP, DKIM selector and certificate. Take it managed, and we run it for you, or buy a licence and run it on your own servers.

# on a fresh Ubuntu server
$ cd pulse && sudo ./install.sh
→ docker compose up · kumomta · stalwart · caddy
→ dashboard ready on https://pulse.yourdomain.com
$

Also from us:Beat: monitoring that tells you the fixConsulting: $65/hr, no retainer