How to manage Qmail queue in Linux Plesk

Plesk server uses qmail as a mail server. Following are some of the qmail commands for Plesk server.

1) To check the mail queue in plesk from command line, you can use the command :




messages in queue: 10

messages in queue but not yet preprocessed: 0

2) You can examine the queue with qmail-qread.


3) From the qread command you get the message’s id . In the above example , one of the id is 524514 . Now you can find the file holding the email in/var/qmail/queue with “find “command.


find /var/qmail/queue -iname 524514







4) From the mail header you get the IP address

vi /var/qmail/queue/mess/22/524514

5) If you wish to remove the emails with some patterns , you can use qmail-remove ( You can download it from here )


/etc/init.d/qmail stop

       (Stop qmail before removing)


# /var/qmail/bin/qmail-remove -r -p “Time Passing”

(considering that “Time Passing” was the subject of the email )

The above steps can be used to track Spammers .

Do you wish to completely remove all the mails from queue? Just run the below commands.

find /var/qmail/queue/mess -type f -exec rm {} \;


find /var/qmail/queue/info -type f -exec rm {} \;

find /var/qmail/queue/local -type f -exec rm {} \;

find /var/qmail/queue/intd -type f -exec rm {} \;

find /var/qmail/queue/todo -type f -exec rm {} \;

find /var/qmail/queue/remote -type f -exec rm {} \;




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s