Is there any way to purge a queue using the source domain?

Hi! Looks like one of our senders had an infinite loop. How do we purge the queue based on the source domain?

Uhh, I need to drop the spool somehow

Looks like I can’t use kcli bounce to do that

I’ll start tagging customers’ User IDs as campaigns and drop emails with that

 /opt/kumomta/sbin/kcli bounce --campaign u1        --reason 'felt like it'    --duration 50s

Will this also drop ANY stuck emails in the queue? Let’s say, a customer’s site had a glitch, they sent a 100,000 emails, some of them are being ratelimited by Gmail and I want to drop all these emails from the queue no matter what.

I know the User ID and I have assigned the campaign based on it., so I will execute the command above.

Does this clear up the spool and make sure that none of those emails are reattempted and are permanently dropped?

That kcli bounce command will bounce any message with the campaign “u1” for 50 seconds

Will it also clear previous messages?

The default is 5 minutes. You can make it hours if you want to persist for a while to catch new messages

Yes it will purge current messages

Yes, that’s great. That’s exactly what I want

I can stop the flow of new messages from my side, but I wanted the ability to clear the existing queue

But not messages in the scheduled queue so you should also issue a rebind command to push those out of the scheduler

Or wait for the next retry

As long as it drops them at the next retry, that is ok too

What if I don’t do that?

Are they dropped at the next retry?

As long as the duration is longer than the next retry time you are good

The default retry is 20 minutes so make the bounce duration 60 just to make sure

Interesting. I tried it in a few seconds and it did not send any new messages after that. Didn’t use rebind

Not sure how or why that worked