• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Need to view qmail queue

N

NotSoHappy

Guest
How would I view the number of emails in the qmail queue on the server?
 
Thanks for the info. I installed qmHandle and it tells me 7362 messages in remote queue.

I try to run qmHandle -a to send the messages, and it tells me qmail isnt running when it is. I have qmhandle in /var/qmail/sbin

Any suggestions?

Thanks!
 
Here is the full message:

Can't exec "pidof": No such file or directory at /var/qmail/bin/qmHandle line
459 (#1)
(W exec) A system(), exec(), or piped open call could not execute the
named program for the indicated reason. Typical reasons include: the
permissions were wrong on the file, the file wasn't found in
$ENV{PATH}, the executable in question was compiled for another
architecture, or the #! line in a script points to an interpreter that
can't be run for similar reasons. (Or maybe your system doesn't support
#! at all.)

Use of uninitialized value in scalar chomp at /var/qmail/bin/qmHandle line 460 (#1)
(W uninitialized) An undefined value was used as if it were already
defined. It was interpreted as a "" or a 0, but maybe it was a mistake.
To suppress this warning assign a defined value to your variables.

To help you figure out what was undefined, perl tells you what operation
you used the undefined value in. Note, however, that perl optimizes your
program and the operation displayed in the warning may not necessarily
appear literally in your program. For example, "that $foo" is
usually optimized into "that " . $foo, and the warning will refer to
the concatenation (.) operator, even though there is no . in your
program.

Use of uninitialized value in pattern match (m//) at /var/qmail/bin/qmHandle
line 461 (#1)
Qmail isn't running, can't send messages!
 
What exactly is the remote queue anyway? I just recently sent a mailing to 70,000 and I am sure this is related. We had about 10,000 bouncers in the list from what I gathered.

qmHandle hasnt told me much of anything :(
 
qmHandle hasnt told me much of anything
It has told you how many messages are in the outbound (remote) queue, which is what your original post was related to.

The remote queue contains messages outbound to other SMTP servers. The local queue are messages awaiting delivery into the local user maildir/mailboxes.

After installing qmHandle, did you make sure the config paths were proper for your system? From their README file:
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 ddint realize I had to edit variables. What would be the proper settings for a plesk 7.5 reloaded install? Can you help with that?

Thanks!
 
Well I just found out "pidof" is an invalid command on my server so I somehow need to find out the PID of qmail-send so I can put it in there. I ran top but it wasnt on there.

What other options do I have?

Thanks again!
 
I dont even know what I am trying to accomplish here. I guess I wanted a visual of what was in the queue, not just a number.

I dont want to just delete them without knowing what they are, and doing a "./qmail-send" just tells me qmail send is already running. I want these to be pushed through, I dont know what the deal is.

The number is growing too. I am at almost 8000 now. :(
 
I dont even know what I am trying to accomplish here.
I'll refrain from any comment on this line... :D
I guess I wanted a visual of what was in the queue, not just a number.
Ok, I guess it wasn't clear that you wanted a GUI type utility.

qmHandle has a README file which I quoted from.

If the 'pidof' command does not work on your OS, then you will need to refer to your OS docs to find the equivalent. It has worked fine on all the RH type systems I have dealt with, so if you are using some other OS, then I would not be able to assist you on that aspect.

The growing number is more than likely related to your mailing of 70,000 and the high number of bounces you posted. Another thing it could be related to is SPAM bounce/doublebounces. That is an entirely different topic which has been covered in depth numerous times under many Plesk version forums (please use search).

Unfortunately I do not know off hand of a visual or GUI based utility to view the Qmail queue. I use a combination of preventative Qmail settings, and qmHandle to manage my queues.

Your original post was that you wanted to
view the number of emails in the qmail queue
qmHandle does just that for both local and remote queues, and other functions. Sorry it did not fit your needs.
 
I am using RHEL3 with Plesk 7.5.3

I too get the problem when I use the -a option...

- how do I configure the variables? Don find any documentation..

- where you guys got the readme from? Their sourceforge site doesn't have any

Many thanks!
 
You have to download the package and extract it. One of the files in the archive is the README file.
 
I was getting the same error as "NotSoHappy"

for my ($pidcmd) I put "ps -e | grep qmail-send"

then it just prompt these lines:

Qmail isn't running... no need to stop it.
Qmail wasn't running when qmHandle was started, so it won't be restarted.

Any ideas guys?

Right now, whenever I add the -Rt0 to server_args, I will have remote mails stuck in remote queue after a while (2 days about there).. so now my queue is stuck...)

what you guys reckon?
 
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>
 
yah it isn't.. for now i am just manually entering the pid each time.. painful.. ok willgive your suggestion a try
 
Your queue is quite large, it may take a few minutes.

Shall we go back to your original post thread or abandon that one?
 
The -a option will not return any output to the screen. If you want to just delete all messages in the queue, then use the -D option. I believe that's what your original post in the other thread indicated you wanted to do.
 
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>

Actually, on my server, it was -f2 instead of -f1 to get the pid. -f1 brings up a blank.
 
Back
Top