Best way to measure sendmail queue depth?

Lars Kristiansen lars+lister.mailscanner at
Fri Jun 30 18:32:03 IST 2006

> I've been checking sendmail inbound queue depth using a simple readdir
> and dividing the number of entries by two.  This is checked every five
> minutes by Nagios with a 10-second timeout -- because of the timeout and
> the frequency with which I want to do the check, I can't just use, for
> example:
>     mailq |head -1
> ...because under heavy flow conditions the mailq command takes WAY too
> long to parse the entire set of queue files and generates too much load.

mailq -OMaxQueueRunSize=1 -OQueueDirectory=/var/spool/mqueue

More information about the MailScanner mailing list