I’ve been receiving json webhook calls using this code, and added the direction meta and Message-Id header to the log_parameters today and restarted the kumomta daemon, but I’m still only getting Subject, From, customer_id and domain_id in the JSON payload. Am I doing something wrong?
--
local LOG_WEBHOOK_URL = "http://10.1.0.4:4242/log"
local MSG_WEBHOOK_URL = "http://10.1.0.4:4242/message"
local TENANT_CAN_SEND_URL = "http://10.1.0.4:4243/v1/account/%s/can-send"
--
local kumo = require 'kumo'
local sources = require 'policy-extras.sources'
local dkim_sign = require 'dkim_sign'
local log_hooks = require 'policy-extras.log_hooks'
local shaping = require 'policy-extras.shaping'
local sqlite = require 'sqlite'
-- Custom queue helper
local queue_module = require 'queue'
local listener_domains = require 'policy-extras.listener_domains'
local dkim_signer = dkim_sign:setup { '/opt/kumomta/etc/policy/config/dkim.toml' }
local shaper = shaping:setup_with_automation {
publish = { 'http://127.0.0.1:8008' },
subscribe = { 'http://127.0.0.1:8008' },
extra_files = { '/opt/kumomta/etc/policy/config/shaping.toml', '/opt/kumomta/etc/policy/config/shaping-custom.toml' },
}
log_hooks:new_json {
name = "webhook",
-- log_parameters are combined with the name and
-- passed through to kumo.configure_log_hook
log_parameters = {
headers = { 'Subject', 'From', 'Message-Id' },
meta = { 'tenant', 'domain_id', 'customer_id', 'direction' }
},
-- queue config are passed to kumo.make_queue_config.
-- You can use these to override the retry parameters
-- if you wish.
-- The defaults are shown below.
queue_config = {
retry_interval = "1m",
max_retry_interval = "20m",
},
-- The URL to POST the JSON to
url = LOG_WEBHOOK_URL
}
--- the rest of init.lua
Hey there @original-baboon, thanks for posting. Please read the “Troubleshooting” and “How to Ask for Help” buttons below. If you would like a 1:1 support session from the KumoMTA team, details are at the “Book a Support Session” button below.