-
Notifications
You must be signed in to change notification settings - Fork 1
/
sink.lua
60 lines (49 loc) · 1.54 KB
/
sink.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--[[
########################################################
KumoMTA Sink policy (Rename this to init.lua and restart)
This config policy defines KumoMTA as a pure sink.
It will consume and discard all incoming messages
########################################################
]]--
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!
for _, port in ipairs { 25, 2026, 587 } do
kumo.start_esmtp_listener {
listen = '0:' .. tostring(port),
}
end
kumo.start_http_listener {
listen = '0.0.0.0:8000',
}
-- 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 = '/var/spool/kumomta/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 = '/var/spool/kumomta/meta',
}
kumo.configure_local_logs {
log_dir = '/var/log/kumomta',
headers = { 'Subject' },
max_segment_duration = '1 minute',
}
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)