Discard queue in KumoMTA based on recipient domain ?

Hi there, what would be the best way to create a Discard Queue in KumoMTA ? I’ve seen the documentation about Always Suspended Queue (https://docs.kumomta.com/faq/how_do_i_create_an_always_suspended_queue/) but it generates transient failure, not permanent… I’ve seen the Queue Documentation explaining a global discard queue… But my question is what would be the best way to reproduce it, based on a list of a few thousand domains, that will log a specific bounce message ?

Hey there @tireless-tiger, 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.

I think what you want to do is msg:set_meta(‘queue’, null) if the destination domain is in your suppression list.

msg:set_meta('queue', 'null') (note the quotes around 'null') will silently (no logging) discard a message.

We don’t currently have a built-in short cut to discard with a bounce, but you can configure a lua protocol handler that generates bounces if you wish.

Take a look at the AMQP example; Routing Messages via AMQP - KumoMTA Docs.
Instead of setting up the amqp client, you would adapt the send method like this to cause the message to be logged as a bounce:

function sender:send(msg)
  kumo.reject(500, "some bounce message")
end