how to clear mail queue in qmail with vpopmail on redhat linux

Posted on 2007-08-12
Last Modified: 2013-12-16
I have installed qmail with vpopmail and IMAP server.Now mail queue is increased
so please tell me the way to clear the mailqueue .
to see the mail we use "qmailctl stat" command.
Question by:manishsaxena2007
    LVL 43

    Accepted Solution

    hm, I don't know how You can do it with RH. I have custom qmali installation i was cleaning queue following way.
    qmail stop # it's importand that qmail-send is not running
    find /var/qmail/queue -type f | egrep "[[:digit:]]" | xargs rm -fv
    qmail start
    LVL 1

    Assisted Solution

    I use the following script,  change the /var/qmail/queue path if it is different for you.

    cd /var/qmail/queue
    rm -rf info intd local mess remote todo

    mkdir mess

    for i in `seq 0 22`; do
       mkdir mess/$i

    cp -r mess info
    cp -r mess intd
    cp -r mess local
    cp -r mess remote
    cp -r mess todo

    chmod -R 750 mess todo
    chown -R qmailq:qmail mess todo

    chmod -R 700 info intd local remote
    chown -R qmailq:qmail intd
    chown -R qmails:qmail info local remote

    LVL 1

    Expert Comment

    Just to clarify,  This is a script i call clearq.  I can then run it quickly and easily whenever it is needed.

    Author Comment

    Yes I got the solution,
    We can clear the qmail queue easily by installing the QmHandle patch.
    qmHandle is perl script use to provide us the full administration to handle the mail queue.
    You can find it on google as qmHandle-1.2 .

    Manish Saxena
    LVL 19

    Expert Comment

    this is the one I use (works well)

    find /var/qmail/queue -type f | egrep -v "tcpto|mutex" | xargs rm
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
    Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now