Hello!
I am using KumoMTA latest version 2025.12.02-67ee9e96
I’m experimenting with the requeue_message hook using a simple setup.
I have this configuration:
kumo.on(
'requeue_message',
function(msg, smtp_response, insert_context, increment_attempts, delay)
msg:set_meta('queue', 'test-queue')
end
)
kumo.on('get_queue_config', function(domain, tenant, campaign_or_routing_domain)
if domain == 'test-queue' then
return kumo.make_queue_config { retry_interval = "2 minutes" }
end
if domain == 'base-queue' then
return kumo.make_queue_config { retry_interval = "5 minutes" }
end
end)
I also have another queue called base-queue.
With this setup, a message is first sent through base-queue.
When a transient failure occurs, it enters the requeue_message hook, the queue is changed to test-queue, and Kumo immediately retries sending the message. This matches what I expected from reading the documentation/code.
However, I want the message to be moved to the new queue and have its delay computed according to the new queue’s retry policy.
So I tried this:
kumo.on(
'requeue_message',
function(msg, smtp_response, insert_context, increment_attempts, delay)
msg:set_meta('queue', 'test-queue')
msg:set_due(kumo.time.now() + kumo.time.parse_duration('1m'))
end
)
But what happens is:
- The message is received in base-queue
- A transient failure occurs
- requeue_message runs and changes the queue to test-queue
- The message remains in base-queue for the first retry, using base-queue’s delay policy
- Only subsequent retries are sent from test-queue
Why does the first retry still happen from base-queue (when adding msg:set_due(kumo.time.now() + kumo.time.parse_duration('1m')) ?
And more generally, how can I prevent an immediate retry when changing the queue in requeue_message?
Thank you for your help ![]()