1748228 Members
4224 Online
108759 Solutions
New Discussion юеВ

Re: mqueue

 
SOLVED
Go to solution
David Crowe
Advisor

mqueue

Is there a way to monitor the number of messages that are in mqueue? I would like to get an idea as to how many messages are being queued for an extended period of time.
5 REPLIES 5
Pedro Sousa
Honored Contributor

Re: mqueue

Hi David.
I'm not sure of what you want, but if you only wish to see the mail queue:
"sendmail -bp" or "mailq"
to process the queued messages:
sendmail -q -v

The queued messages are stored in /var/spool/mqueue/*

good luck.
Ossie de Jongh
Advisor

Re: mqueue

easy as that ! :)
Robin Wakefield
Honored Contributor
Solution

Re: mqueue

For a count of the number of "deferred" messages, try:

cd /var/spool/mqueue
find . -name "qf*" | xargs grep "^M" | wc -l

(the M line details why the message could not be delivered)

or

find . -name "qf*" | xargs grep "^N[1-9]" | wc -l

(the N line is the retry count)

Robin.
Carlos Fernandez Riera
Honored Contributor

Re: mqueue

Try mailstats.

I guess it need to be configured.

See man mailstats
unsupported
avsrinivas_1
Occasional Advisor

Re: mqueue

use mailq -v to get the mails queued currently.
u can write a script to call the mailq -q and
append the output to a file. later add this
to the cron to get the queued mail status for a period of time.

hope this solves ur need.
Be Dynamic