How to Remove WHM Mail Queue through SSH

If you ever have need to delete specific messages from your mail queue then don’t worry and just use the following commands. This will help you out to get rid of messages in the mail queue.

To view a list of the messages in the queue…

[box style=’info’]  exim -bp[/box]

To remove a single message from the queue…[box style=’info’] exim -Mrm {message-id}[/box]

Deletion of frozen messages use…

[box style=’info’] exim -bpru | grep frozen | awk {‘print $3’} | xargs exim -Mrm [/box]
Deletion of specific sender domains use…
[box style=’info’] exim -bpru | grep ‘@domain.com’ | awk {‘print $3’} | xargs exim -Mrm [/box]
To remove all messages from the queue…[box style=’info’] exim -bp | exiqgrep -i | xargs exim -Mrm [/box]

 

 

 

One Response

  1. whmcs
    whmcs at | | Reply

    Nice post but i do not know how to use SSH, can yo u share some other method of removing the mail queue.

Leave a Reply