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
-
# /var/qmail/bin/qmail-qstat
2) You can examine the queue with qmail-qread.
# /var/qmail/bin/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.
/var/qmail/queue/remote/22/524514
/var/qmail/queue/mess/22/524514
/var/qmail/queue/info/22/524514
-
# 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 )
# /var/qmail/bin/qmail-remove -r -p “Time Passing”
-
# /etc/init.d/qmail stop (Stop qmail before removing)
(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/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 {} \;
find /var/qmail/queue/mess -type f -exec rm {} \;
Quelle http://24x7servermanagement.com/blog/?p=845
