Hello all. I am new with Kumomta. I am getting the above error.
So I added this to my init.lua
kumo.on(‘smtp_server_message_received’, function(msg)
math.randomseed(os.time())
local character_set = “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789”
local function generateRandomString(length)
local random_string_table = {}
local set_length = #character_set
for i = 1, length do
local random_index = math.random(1, set_length)
table.insert(random_string_table, string.sub(character_set, random_index, random_index))
end
return table.concat(random_string_table)
end
local myRandomString = generateRandomString(24)
msg:append_header(“Message-ID”, myRandomString)
queue_helper:apply(msg)
end)
I am still getting error.
I thought I read that Kumo should add a Message-ID without any new code.
local kumo = require ‘kumo’
local utils = require ‘policy-extras.policy_utils’
local shaping = require ‘policy-extras.shaping’
local queue_module = require ‘policy-extras.queue’
local listener_domains = require ‘policy-extras.listener_domains’
local sources = require ‘policy-extras.sources’
local log_hooks = require ‘policy-extras.log_hooks’
kumo.on(‘smtp_server_message_received’, function(msg)
math.randomseed(os.time())
local character_set = “abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789”
local function generateRandomString(length)
local random_string_table = {}
local set_length = #character_set
for i = 1, length do
local random_index = math.random(1, set_length)
table.insert(random_string_table, string.sub(character_set, random_index, random_index))
end
return table.concat(random_string_table)
end
local myRandomString = generateRandomString(24)
msg:append_header(“Message-ID”, myRandomString)
queue_helper:apply(msg)
end)
Yes, according to the specs, the MTA is not supposed to be the thing that adds a Message-ID header, it is supposed to already be present in the message that is sent to/through it. You can optionally configure KumoMTA to check for a missing header and add one as discussed above