DSN notify success confuguration

Hi, I need to get a success DNS for the sending client. I tried using kumo.generate_rfc3464_message, but I don’t get a successful delivery report. The client requests NOTIFY = success.
Can you tell me if this is possible? I saw a similar question on Discord, but it’s been a while, so maybe something has changed.

1. kumod 2025.12.02-67ee9e96

2. Linux e8d0f75fc73f 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux

local domain_helper = listener_domains:setup {
  '/opt/kumomta/etc/policy/listener_domains.toml'
}
kumo.on('get_listener_domain', domain_helper)

kumo.on('smtp_server_ehlo', function(domain, conn_meta, extensions)
  table.insert(extensions, 'DSN')
  table.insert(extensions, 'ENHANCEDSTATUSCODES')
  return extensions
end)

kumo.on('smtp_server_message_received', function(msg)
  local env_id = msg:id()
  local sender = tostring(msg:sender() or "<>")
  local rcpt   = tostring(msg:recipient() or "<unknown>")

  kumo.log_info(string.format(
    "Message accepted (success): %s from %s to %s",
    env_id,
    sender,
    rcpt
  ))
end)

kumo.on('get_queue_config', function(domain)
  local mx_list = nil
  if domain == 'postfix.local' then
    mx_list = { '10.200.0.134:25' }
  end
  return kumo.make_queue_config {
    protocol = { smtp = { mx_list = mx_list } },
    retry_interval = '30s',
    max_retry_interval = '1m',
    max_age = '5m',
  }
end)


kumo.on('get_egress_path_config', function()
  return kumo.make_egress_path {
    enable_tls = 'Opportunistic',
  }
end)


kumo.on('delivery_succeeded', function(msg, response)
  kumo.log_info('Delivery succeeded for envelope ' .. msg:id())
end)

kumo.on('delivery_failed', function(msg, response)
  kumo.log_info('Generating FAILURE DSN for ' .. msg:id())
  local dsn_msg = kumo.generate_rfc3464_message {
    type = 'failure',
    msg = msg,
    response = response,
  }
  if dsn_msg then
    local ok, err = pcall(kumo.inject_message, dsn_msg)
    if ok then
      kumo.log_info('FAILURE DSN injected OK')
    else
      kumo.log_error('FAILURE DSN inject failed: ' .. tostring(err))
    end
  else
    kumo.log_warn('generate_rfc3464_message returned nil')
  end
end)

kumo.on('init', function()
  kumo.define_spool { name = 'data', path = '/var/spool/kumomta/data' }
  kumo.define_spool { name = 'meta', path = '/var/spool/kumomta/meta' }

  kumo.configure_local_logs { log_dir = '/var/log/kumo' }

  kumo.configure_bounce_classifier {
    files = { '/opt/kumomta/share/bounce_classifier/iana.toml' },
  }

  kumo.dns.configure_resolver { name_servers = { '10.200.0.133:53' } }

  kumo.start_esmtp_listener {
    listen = '0.0.0.0:2025',
    relay_hosts = { '10.200.0.0/20', '127.0.0.1' },
  }
end)

Start by throwing away whatever GPT tool you are using. Your code as presented has hallucinated events and functions.

Second, question why your customer needs success notifications as a DSN, in a modern environment it is not even remotely the most effective way to convey such information, especially compared to things like webhooks. It is not easily machine parsed, so unless your client literally wants to read DSNs telling them a message was accepted by the remote host it’s not good for system to system updates, and on top of that it’s incredibly inefficient compared to other options.

At this time `kkumo.generate_rfc3464_message does not support generating rfc3464 messages for successful delivery because it has never come up as a use case, so you would need to manually generate a DSN message in Lua and inject it to support this case.

Thanks for the quick response! Is there currently no way to generate a DNS for a client using kumoMTA if they request one? “in Lua” Can this be defined in init.lua?

It can be defined in init.lua, but again: not every client request should be blindly implemented. Success DSNs are so unusual it’s incredibly unlikely it’s the right answer for your customer’s use case, which you have not actually defined.

KumoMTA acts as a relay for mail from the service. The sending service typically waits for the mail server to confirm DSN delivery with a response. Unfortunately, this is the scenario.
If this can be done using LUA, could you tell me how?

From my perspective in understanding your question — though I’m not sure if I’m entirely correct — KUMOMTA, as an MTA tool, is responsible for receiving and sending emails, which is absolutely right. However, regarding DSN Delivery, I’d like to explain the following:

  1. Performance considerations: When the business system sends emails to Kumomta, it defaults to being successful. If a DSN report were generated for every successfully delivered message, it would be disastrous in scenarios involving even moderately high sending volumes.
  2. Using Webhooks to push “Bounce”-type data back to the business system, such as bounce or expiration information.

Simply : default to success, and notify failures via webhook.