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 :
[root@vps init.d]# /var/qmail/bin/qmail-qstat
messages in queue: 1
messages in queue but not yet preprocessed: 0
[root@vps init.d]#
2) You can examine the queue with qmail-qread.
# /var/qmail/bin/qmail-qread
root@vps init.d]# /var/qmail/bin/qmail-qread
16 Sep 2011 06:14:22 GMT #218926412 299 anonymous@vps.test.com
remote dave@davidlbird.com
[root@vps init.d]#
3) From the qread command you get the message’s id . In the above example , one of the id is 218926412 . Now you can find the file holding the email in/var/qmail/queue with “find “command.
[root@vps init.d]# find /var/qmail/queue -iname 218926412
/var/qmail/queue/mess/15/218926412
/var/qmail/queue/remote/15/218926412
/var/qmail/queue/info/15/218926412
[root@vps init.d]# vi /var/qmail/queue/mess/22/524514
Received: (qmail 9264 invoked by uid 10000); 16 Sep 2011 06:14:22 -0700
Date: 16 Sep 2011 06:14:22 -0700
Message-ID: <20110916131422 .9260.qmail=".9260.qmail" vps.pcbuniverse.com="vps.pcbuniverse.com">
To: Dave@DavidLBird.com
Subject: the subject
From: tchase@pcbuniverse.com
Reply-To: tchase@pcbuniverse.com
X-Mailer: PHP/5.1.6
hello
~20110916131422>
5) If you wish to remove the emails with some patterns , you can use qmail-remove ( You can download it from http://www.linuxmagic.com/opensource/qmail/qmail-remove )
# /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 {} \;
No comments:
Post a Comment