Friday, November 28, 2008

Plesk and qmail

I spent several hours this evening tying down a problem with the qmail server on one of our machines. Eventually, I found that 77000 messages had been sent from an auto-emailer function triggered by a malformed piece of MySQL on another server.

However, it has allowed me to find a use a couple of command line functions that I’ve not really used all that much before

/etc/init.d/qmail stop | start | restart

/var/qmail/bin/qmail=qstat

qmHandle -l

qmHandle -h’Subject: blah’

qmHandle is a helpful command line tool that allows you to manipulate the qmail queue (remembering that you need to edit the perl script once downloaded to set the user config)

# Set this to your qmail queue directory (be sure to include the final slash!)
my ($queue) = ‘/var/qmail/queue/’;
my ($bigtodo) = (-d “${queue}todo/0″) ? 0 : 1; # 1 means no big-todo

# While this is if you have a Debian GNU/Linux with its qmail package
my ($stopqmail) = ‘/etc/init.d/qmail stop’;
my ($startqmail) = ‘/etc/init.d/qmail start’;

# Enter here the system command which returns qmail PID.
my ($pidcmd) = ‘pidof qmail-send’;

No comments: