Skip to content
Module 6 · Lesson 12 of 25

DKIM signing in KumoMTA

Part of KumoMTA: High-Volume Sending Engine, in the DKIM Signing, SPF & DMARC Alignment module.

Author

Define a signer in init.lua:

local signer = kumo.dkim.rsa_sha256_signer {
  domain   = 'example.com',
  selector = 's2026',
  headers  = { 'From', 'To', 'Subject', 'Date', 'Message-ID', 'List-Unsubscribe' },
  key      = '/etc/kumomta/dkim/example.com/s2026.key',
}

kumo.on('smtp_server_message_received', function(msg)
  msg:dkim_sign(signer)
end)

Publish public key at s2026._domainkey.example.com IN TXT:

v=DKIM1; k=rsa; p=MIIBIjANBg...

Multi-tenant signing:

kumo.on('smtp_server_message_received', function(msg)
  local domain = msg:from_header_address():match('@(.+)$'):lower()
  local signer_for_domain = signers_by_domain[domain]
  if signer_for_domain then msg:dkim_sign(signer_for_domain) end
end)

Always 2048-bit RSA. Rotate selectors yearly. Always sign List-Unsubscribe, because that's how Gmail's one-click unsub validates.

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