Skip to content
Module 5 · Lesson 11 of 25

Egress sources and pools in code

Part of KumoMTA: High-Volume Sending Engine, in the IP Warming Strategies & Pools module.

Author

Define sources (one per outbound IP):

kumo.on('init', function()
  for i = 1, 8 do
    kumo.define_egress_source {
      name = 'ip-' .. i,
      source_address = '198.51.100.' .. (10 + i),
      ehlo_domain    = 'mail' .. i .. '.example.com',
    }
  end

  kumo.define_egress_pool {
    name = 'warming-pool',
    entries = {
      { name = 'ip-1', weight = 1 },
      { name = 'ip-2', weight = 1 },
      -- equal-weight rotation
    }
  }

  kumo.define_egress_pool {
    name = 'production-pool',
    entries = {
      { name = 'ip-3', weight = 5 },
      { name = 'ip-4', weight = 5 },
      { name = 'ip-5', weight = 3 },
    }
  }
end)

Select pool per-message:

kumo.on('get_queue_config', function(domain, tenant, campaign)
  local pool = 'production-pool'
  if tenant == 'new-customer' then pool = 'warming-pool' end
  return kumo.make_queue_config { egress_pool = pool }
end)

Enforce daily caps with the throttles module, a per-source message bucket reset at midnight. This is your warming enforcer.

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