What Operating System are you seeing this problem on?
Ubuntu 20
Linux kdev2.kumomta.com 5.15.0-1039-azure #46~20.04.1-Ubuntu SMP Mon May 22 19:42:46 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
What Hardware is this system running?
Azure Standard D8lds v5 (8 vcpus, 16 GiB memory)
KumoMTA version
kumod 2023.06.13-2992e421
Did you try the latest release to see if the issue is better (or worse!) than your current version?
Yes, and I updated the version box above to show the version that I tried
Describe the bug
Mail not sending and a debug trace shows no source assignment and this trace message:
stack traceback:
[C]: in function 'kumo.make_egress_pool'
/opt/kumomta/share/policy-extras/sources.lua:93: in function </opt/kumomta/share/policy-extras/sources.lua:91>
caused by: deserialize error: missing field `name`
Adding a ` print(kumo.json_encode(data.pools[pool_name]))` on line 92 showed that the required poll name was not in the data.
To fix, you need to add "name = pool," to the data:
@@ -14,6 +14,7 @@ local function load_data_from_file(file_name, target)
for pool_source, params in pairs(pool_def) do
target.pools[pool] = target.pools[pool]
or {
+ name = pool,
entries = {},
}
Note: after fixing the issue, I noticed the same thing in the source data and a similar fix was needed.
The final fix with both changes looks like this:
local function load_data_from_file(file_name, target)
local data = utils.load_json_or_toml_file(file_name)
for source, params in pairs(data.source) do
target.sources[source] = target.sources[source]
or {
name = source,
entries = {},
}
utils.merge_into(params, target.sources[source])
end
for pool, pool_def in pairs(data.pool) do
for pool_source, params in pairs(pool_def) do
target.pools[pool] = target.pools[pool]
or {
name = pool,
entries = {},
}
params.name = pool_source
table.insert(target.pools[pool].entries, params)
end
end
end
To Reproduce
Configure to use the sources helper (https://docs.kumomta.com/userguide/configuration/sendingips/?h=helper#using-the-sourceslua-policy-helper)
Add a debug trace to the config in the init section:
kumo.set_diagnostic_log_filter 'kumod=trace'
restart and tail the system log:
sudo systemctl stop kumomta.service
sudo systemctl start kumomta.service
journalctl -f -n100 -u kumomta.service
Configuration
In egress_sources.toml:
# Pool Definitions
[pool.'default']
[pool.'default'.'tomtest']
# Egress IP Definitions
[source.'tomtest']
source_address = '10.0.0.9'
ehlo_domain = 'kdev2.aasland.com'
In init.lua:
local sources = require 'policy-extras.sources'
sources:setup { '/opt/kumomta/etc/policy/egress_sources.toml' }
Expected Behavior
assign a source and pool and send mail
Anything else?
See above