mirror of
https://github.com/KumoCorp/kumomta.git
synced 2026-08-18 16:01:07 +00:00
403f80ac26
These files are used by me (wez!) while hacking things together locally as a non-privileged user (myself). They should not contribute to the overall message accounting database. Let's give each instantiation a separate temporary path.
46 lines
1.2 KiB
Lua
46 lines
1.2 KiB
Lua
-- This config acts as a sink that will discard all received mail
|
|
local kumo = require 'kumo'
|
|
|
|
kumo.on('init', function()
|
|
kumo.configure_accounting_db_path(os.tmpname())
|
|
-- Define a listener.
|
|
-- Can be used multiple times with different parameters to
|
|
-- define multiple listeners!
|
|
for _, port in ipairs { 2026 } do
|
|
kumo.start_esmtp_listener {
|
|
listen = '0:' .. tostring(port),
|
|
relay_hosts = { '0.0.0.0/0' },
|
|
}
|
|
end
|
|
kumo.start_http_listener {
|
|
listen = '0.0.0.0:8002',
|
|
trusted_hosts = { '127.0.0.1', '::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)
|
|
|
|
kumo.on('http_message_generated', function(msg)
|
|
-- Accept and discard all messages
|
|
msg:set_meta('queue', 'null')
|
|
end)
|