N
NotSoHappy
Guest
How would I view the number of emails in the qmail queue on the server?
It has told you how many messages are in the outbound (remote) queue, which is what your original post was related to.qmHandle hasnt told me much of anything
CONFIGURATION
-------------
There are only a few variables to configure, and this has to be done depending
on your system and qmail installation. You can find the variables at the top of
the Perl script qmHandle (there's a configuration section properly marked).
The variables are:
1) my ($queue) = '/var/qmail/queue/';
This is the path of your qmail queue directory. It's located here on 99.9%
of qmail installation. If yours seems not to be there, try using the "find"
command to locate it.
2) my ($stopqmail) = '/etc/init.d/qmail stop';
This is the name of the script/command which stops qmail. The one you
see works on Debian GNU/Linux, if you have other you need to change it.
In the script configuration section you'll find some examples of
common options, including the one using DJB's daemontools. If you
don't have any script to stop qmail, you *must leave this string
empty*:
$stopqmail = '';
3) my ($startqmail) = "/etc/init.d/qmail start";
This is the name of the script/command which stops qmail. The one you
see works on Debian GNU/Linux, if you have other you need to change it.
In the script configuration section you'll find some examples of
common options, including the one using DJB's daemontools and the
standard qmail distribution.
4) my ($pidcmd) = 'pidof qmail-send';
This is the command used to obtain qmail process id. The default
should work on most Unix systems, but if on yours doesn't you can
change it.
Please note that variables from 2 to 4 are only needed to set properly
if you need to use qmHandle to delete messages in the queue. The first
one is however needed in any case.
I'll refrain from any comment on this line...I dont even know what I am trying to accomplish here.
Ok, I guess it wasn't clear that you wanted a GUI type utility.I guess I wanted a visual of what was in the queue, not just a number.
qmHandle does just that for both local and remote queues, and other functions. Sorry it did not fit your needs.view the number of emails in the qmail queue
Originally posted by jamesyeeoc
Your replacement for pidof needs to be modified. What it is returning now is not just the pid number, it is returning something like:
2936 ? 00:00:00 qmail-send
Which is not being interpreted properly. Try changing your command to:
my ($pidcmd) = "ps -e |grep 'qmail-send' |cut -d ' ' -f 1";
<Edit: My original post has been corrected to reflect -f1 instead of -f2, my error, typo>