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.
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
In the sendmail
Inexplicably, it is not included with the main CentOS sendmail package, you can find it in the sendmail-doc rpm though (thanks to kubanczyk for noting this), or you can extract it from the source distribution ( ftp://ftp.sendmail.org/pub/sendmail/sendmail-current.tar.gz ). It has minimal dependencies, they should all be part of a normal perl installation.
To delete messages use
To move them to an offline mqueue directory (safer):
Note it's "
You have the option of running that queue later with
(Older versions of