I'm running centos and have a rediculous amount of emails in the mailqueue due to a script error. Is there any way to remove messages that have a certain subject line in sendmail's mailqueue.
Linux – Remove messages from sendmail queue matching subject
centoslinuxsendmail
Related Topic
- Centos – Messages stuck in sendmail queue beyond confTO_QUEUERETURN lifetime
- Linux – Delete from mailq where subject matches
- Centos – sendmail queue – display number of messages per domain
- Linux – Is it possible to include subject lines in the default sendmail maillog
- How many simultaneous connections does SendMail allow/open when relaying new (and deferred) messages to a common downstream MTA
Best Answer
This worked for me just now, in testing (which is why it has such a weird subject line embedded in the code). It relies on the fact that the two files that make up a message in sendmail queue share the same filename except for the first character.
Once you're happy with the list of files it produces, change
echo
torm
. Don't forget to stop sendmail before you mess with its queue like this; it may become surly if the queue changes underneath it.