Delete Message From Queue
From Roaring Penguin
Deleting one or more messages from the queue isn't a very user-friendly way to do it but it is possible.
- You will first need the Sendmail queueID of the message. This is the first column that the mailq command gives. Or, in the CanIt web interface it's the Queue ID column in the intial Search Log results. Or, in CanIt's web interface it's the first column where queued items are shown.
- Next get a root shell on the server where the mail is queued, and go to /var/spool/mqueue or /var/spool/mqueue-client if the message is in the clientmqueue (more likely it is in the former, though).
- Here there will be pairs files of the form: qf<queuID> and df<queueID>. Remove them
both for your queue id, so if the queueID is s4REBwPJ013078 then do:
rm dfs4REBwPJ013078; rm qfs4REBwPJ013078
The df- file contains the actual message data and the qf- file contains queue information for Sendmail.