How to search through queued email by content
Explanation by part
grep -rl exampledomain.com /var/spool/exim/input/*
Search for exampledomain.com in all queued messagesn and returns a list of file paths.
grep -oP '[^/\n]+$’
Find the last part of the path, i.e., the filename
The filename’s byte 1 through 16 constitutes the exim message ID.
xargs exim -Mrm
Pipe the message ID to exim’s “delete from queue” function.
Warning! Add this only if you want to delete the matching messages.