mirror of
https://github.com/mailscope/kumomta.git
synced 2026-08-18 18:38:18 +00:00
25ef5fcf70
These were accidentally checked in as part of be80391239
24 lines
557 B
Lua
24 lines
557 B
Lua
local tsa = require 'tsa'
|
|
local kumo = require 'kumo'
|
|
|
|
kumo.on('tsa_init', function()
|
|
tsa.start_http_listener {
|
|
listen = '0.0.0.0:8008',
|
|
trusted_hosts = { '127.0.0.1', '::1' },
|
|
}
|
|
end)
|
|
|
|
local cached_load_shaping_data = kumo.memoize(kumo.shaping.load, {
|
|
name = 'tsa_load_shaping_data',
|
|
ttl = '5 minutes',
|
|
capacity = 4,
|
|
})
|
|
|
|
kumo.on('tsa_load_shaping_data', function()
|
|
local shaping = cached_load_shaping_data {
|
|
'/opt/kumomta/share/policy-extras/shaping.toml',
|
|
-- '/opt/kumomta/etc/policy/shaping.toml',
|
|
}
|
|
return shaping
|
|
end)
|