Files
kumomta/sink.lua
T
Wez Furlong 054501e535 some basic plumbing for configuring outbound settings
A callback is used to resolve the config at the time that
we set up the destination site structure (eg: when we get the first
ready-to-send message for it, and again after it has idled out).

This is used in the example configs to enable "OpportunisticInsecure"
TLS mode so that we can successfully delivery over TLS to the
default self-signed TLS certs on the sink.
2023-02-17 13:52:34 -07:00

35 lines
940 B
Lua

local kumo = require 'kumo'
-- This config acts as a sink that will discard all received mail
kumo.on('init', function()
-- Define a listener.
-- Can be used multiple times with different parameters to
-- define multiple listeners!
kumo.start_esmtp_listener {
listen = '127.0.0.1:2026',
relay_hosts = { '127.0.0.1', '192.168.1.0/24' },
}
-- Define the default "data" spool location.
-- This is unused by this config, but we are required to
-- define a default spool location.
kumo.define_spool {
name = 'data',
path = '/tmp/kumo-sink/data',
}
-- Define the default "meta" spool location.
-- This is unused by this config, but we are required to
-- define a default spool location.
kumo.define_spool {
name = 'meta',
path = '/tmp/kumo-sink/meta',
}
end)
kumo.on('smtp_server_message_received', function(msg)
-- Accept and discard all messages
msg:set_meta('queue', 'null')
end)