How to remove email from a sendmail queue

Discussion in 'Sendmail' started by popowich, Aug 21, 2012.

  1. popowich

    popowich EQ Forum Admin Staff Member

    Aug 12, 2008
    Likes Received:

    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:

    [COLOR=Red]q7ICYnR3009369[/COLOR]  3801057 Sat Aug 18 08:34 <>
                     (reply: read error from
    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:


    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.

Want to reply or ask your own question?

It only takes a minute to sign up (and it's free!). Click the orange sign up button to choose a username and then you can ask your own questions on the forum.