Exim comes with an excellent utility called exiqgrep
which has lots of grep like functionality on queues. For example to find all messages which has [email protected] as recipient:
exiqgrep -r [email protected]
If you want to search for from address not recipient, change -r
with -f
parameters. You can also delete the messages after finding them:
exiqgrep -f [email protected] | awk {'print $3'} | xargs -Mrm