KumoMTA uses Lua in place of a more traditional formatted configuration file.
Lua is a surprisingly powerful configuration language, allowing you to either statically define configuration or dynamically build it by pulling from multiple data sources.
Helpers
In order to make KumoMTA more accessible for those who are accustomed to a static configuration file and don’t need deeper integration, we have developed a set of policy helpers. These helpers are premade Lua policy scripts that implement common use cases by reading formatted TOML and JSON files to configure KumoMTA.
Concepts
Init script
Configuration starts in /opt/kumomta/etc/policy/init.lua
, and we will use the example provided in the documentation as a starting point.
- ✅ setup sources
sources.toml
sending IP addresses - ✅ setup
dkim_signer
dkim_data.toml
- ✅ setup automation traffic
shaper
shaping.toml
(ESP policies) - log hooks
- ✅ setup queue management
queues.toml
- Events:
- init
- storage: data, metadata, logs
shaper
- bounce
- HTTP listener
- SMTP listener
- ✅ get_listener_domain
listener_domains.toml
for relay, oob bounces, and FBLs messages - egress path from
shaper
- smtp message receive: queue,
dkim_signer
- init
sources.toml
DKIM and dkim_data.toml
selector: s1
s1._domainkey.smtp.kyr.sh
export DOMAIN=smtp.kyr.sh
export SELECTOR=s1
sudo mkdir -p /opt/kumomta/etc/dkim/$DOMAIN
sudo openssl genrsa -f4 -out /opt/kumomta/etc/dkim/$DOMAIN/$SELECTOR.key 1024
sudo openssl rsa -in /opt/kumomta/etc/dkim/$DOMAIN/$SELECTOR.key -outform PEM -pubout -out /opt/kumomta/etc/dkim/$DOMAIN/$SELECTOR.pub
sudo chown kumod:kumod /opt/kumomta/etc/dkim/$DOMAIN -R
Add a TXT
record to DNS with the content:
v=DKIM1; k=rsa; h=sha256; p=MIbBa...DaQAB
dkim_data.toml
Automation shaper
The shaping lua helper will include the community managed https://github.com/KumoCorp/kumomta/blob/main/assets/policy-extras/shaping.toml