How to remove email from a sendmail queue

popowich

EQ Forum Admin
Staff member
Hello,

A couple steps are needed to delete an email from a sendmail queue.

All of the following commands should be run as root

First, run the mailq command to find the message you want to delete.

> mailq

In this example the email I want to delete has this output:

Code:
[COLOR=Red]q7ICYnR3009369[/COLOR]  3801057 Sat Aug 18 08:34 <user@example.com>
                 (reply: read error from mail.example.com.)
Note the identifier I marked in red above, there will be two files with that identifier in the name that need to be removed.

Next, cd /var/spool and then find the files with that name in them.

> cd /var/spool/
> find . -name "*7ICYnR30093*"


The output I got from the find commmand was:

./mqueue/dfq7ICYnR3009369
./mqueue/qfq7ICYnR3009369


To remove the email from the queue, delete the files:

> rm ./mqueue/dfq7ICYnR3009369 ./mqueue/qfq7ICYnR3009369

On some systems the folder might be named clientmqueue.

If you need to delete all email from the queue you can remove all files in the mqueue folder.
 
Top