Files
kumomta/crates/integration-tests/sink.lua
T
Wez Furlong 6e15132be0 more tweaks to integration tests
trying to figure out why they hang on GH actions
2023-03-07 22:07:28 -07:00

32 lines
670 B
Lua

local kumo = require 'kumo'
-- This config acts as a sink that will discard all received mail
local TEST_DIR = os.getenv 'KUMOD_TEST_DIR'
kumo.on('init', function()
kumo.start_esmtp_listener {
listen = '127.0.0.1:0',
relay_hosts = { '0.0.0.0/0' },
}
kumo.configure_local_logs {
log_dir = TEST_DIR .. '/logs',
max_segement_duration = '1s',
}
kumo.define_spool {
name = 'data',
path = TEST_DIR .. '/data-spool',
}
kumo.define_spool {
name = 'meta',
path = TEST_DIR .. '/meta-spool',
}
end)
kumo.on('smtp_server_message_received', function(msg)
-- Accept and discard all messages
msg:set_meta('queue', 'null')
end)