Skip to content
Module 3 · Lesson 7 of 25

SMTP AUTH and rate limiting at the listener

Part of KumoMTA: High-Volume Sending Engine, in the Listeners, ESMTP, AUTH & TLS module.

Author

Wire up SASL PLAIN/LOGIN auth:

kumo.on('smtp_server_auth_plain', function(authz, authc, password, conn_meta)
  -- Look up credentials in your DB / file / Vault
  local ok = verify_password(authc, password)
  if ok then
    conn_meta:set_meta('tenant', tenant_for_user(authc))
    return true
  end
  return false
end)

You decide where credentials live: passwd-file, MySQL, Vault, HTTP API. KumoMTA just calls your function.

Per-listener rate limit to slow brute-force:

kumo.start_esmtp_listener {
  listen = '0.0.0.0:587',
  max_messages_per_connection = 1000,
  max_recipients_per_message  = 100,
  data_buffer_size           = '32MB',
  max_message_rate           = '50/s',  -- per source IP
}

Bind tenant metadata at AUTH time. Everything downstream (throttles, IP pool, queue selection) reads conn_meta for tenant. Get this right and the rest of the config writes itself.

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