Just a quick & dirty hack to delete frozen messages for a single / some recipient(s)…
#!/bin/bash
#
# what are we searching for?
# (part of the email-address)
SEARCH="anyrecipient.tld"
#
# exim-bin
EXIM=`which exim`
#
# execute (frozen messages only)..
$EXIM -Mrm $(mailq | grep $SEARCH -B1 | grep frozen |cut -c 11-27)
Thanks to Mark -> this can be done a lot of easier if you want to kill all frozen messages:
exiqgrep -z -i | xargs exim -Mrm
If you want to do this only for some domains / email-addresses, use the first example.
3 thoughts on “exim / remove (all) frozen messages from queue”
Comments are closed.
exiqgrep -z -i | xargs exim4 -Mrm
@Mark -> Thanks for the hint 🙂
Learn exipick — it is AWESOME and far more flexible than exiqgrep.
expick is 100% options compatible, so this still works:
exipick -z -i | xargs exim -Mrm
… but you can also construct complex queries involving spam scores, Subject (or any other header or exim variable) and you can combine all these selectors in one command.