-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.lua
80 lines (68 loc) · 1.94 KB
/
init.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
--[[
########################################################
KumoMTA Sink policy (Renamed init.lua for systemd automation)
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 } 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',
per_record = {
Reception = {
suffix = '_recv',
},
Delivery = {
suffix = '_deliv',
},
TransientFailure = {
suffix = '_trans',
},
Bounce = {
suffix = '_bounce',
},
-- For any record type not explicitly listed, apply these settings.
-- This effectively turns off all other log records
Any = {
suffix = '_any',
},
},
}
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)