Hello, trying out kumoMTA, currently we got it set up so we can send (limited) emails.
We were looking further into the x-headers and how to add them, but we can’t see them inside the ‘http_message_generated’ event
I can add them manually with msg:add_header, it’s also configured in queues to not remove the header. so I must be doing something wrong doing the http call.
Are there some hints or tips for me to figure out this issue?
`kumo.on(‘http_message_generated’, function(msg)
local tenant = msg:get_first_named_header_value(‘X-Tenant’)
if not tenant then
kumo.reject(500, “No tenant”)
end
– Call the queue helper to set up the queue for the message.
queue_helper:apply(msg)
-- Scheduling
--msg:import_scheduling_header 'X-Schedule'
-- SIGNING MUST COME LAST OR YOU COULD BREAK YOUR DKIM SIGNATURES
dkim_signer(msg)
end)`
curl -i 'http://localhost:80/api/inject/v1' -H 'Content-Type: application/json' -d '{"envelope_sender":"ok@service.slgnt.eu","content":{"subject":"hello\n\nHello there","html_body":"<html>This is the HTML content of the message</html>","text_body":"This is the Text content of the message","from":{"email":"ok@service.slgnt.eu","name":"Test"},"headers":{"X-Tenant":"EU.SMC"}},"recipients":[{"email":"ubuntu@kumo.edc.com"}]}' init.lua (5.7 KB) queues.toml (1.63 KB)
for reference, this is the response: { "success_count": 0, "fail_count": 1, "failed_recipients": [ "ubuntu@kumo.edc.com" ], "errors": [ "ubuntu@kumo.edc.com: 500 No tenant\nstack traceback:\n\t[C]: in function 'kumo.reject'\n\t[string \"/opt/kumomta/etc/policy/init.lua\"]:260: in function <[string \"/opt/kumomta/etc/policy/init.lua\"]:257>\n" ] }