Emptying the mailq

I used to visit the bytemark forums to remember the syntax for this but they are sadly no more.

I seem to remember using exiqgrep but that doesn’t seem to work. Can anyone point me to the right syntax to remove all frozen emails?

I used to use mailq and exim4 -Mrm, one message at a time.
exiqgrep -z would be slightly better as it only lists the frozen messages.
If there’s a simple way to remove all frozen messages at once I don’t know it, but that doesn’t mean there isn’t, only that I don’t know much about exim!

Yes, it’s a shame the B’mark forum is now offline, it was a great source of documented issues and solutions.
There’s a good Exim cheat sheet here: Exim CheatSheet for Devs and System Administrators

1 Like

Thanks - useful and saved for future reference!

Oh, and remember Exim is one of those open source projects that’s extremely well documented. At exim.org In sympl/symbiosis there are just a few things that you won’t find documented there:

  1. The “by parts” nature of the configuration file construction. That’s a Debian thing, that’s a bit different than how Exim configurations are usually built. Nevertheless, you end up with an Exim configuration that’s very useful and the content of the configuration file is all standard Exim.

  2. The specific configuration differs quite a lot from Exim’s default configuration.

  3. The binary is precompiled. The compilation options for Sympl aren’t documented at exim.org, but you can find them with “exim -bV”, and the behaviour and configuration of the complied parts will all be documented at exim.org

1 Like

Thanks all for the links and tips. A real shame the old bytemark forum was taken down and frustrating that is was done without any notice. A very different company now to that of times gone by.

I found the command exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash does the trick.

My favourite Exim cheatsheet is at Exim Cheatsheet.

(Although I have most of it memorised by now.)

Be very careful with that one, it’s a bit brute-forcey, and it will remove all mail in the queue, not just frozen mail, so there’s a chance legitimate mail may go missing.

Thanks for that, and the link. I did pause the que before I did that just in case but now I see there is a far better option I will use that in future.

exiqgrep -z -i | xargs exim -Mrm
1 Like