OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Recommended way to (quickly) get total mail queue size?

From: Bill Anderson (billnoreboots.com)
Date: Tue Jul 07 2009 - 14:11:02 CDT


>
> Slowest: mailq/postqueue -p, because that opens each file.

This would also be unwise given that mailq/postqueue -p can return
incomplete results when the number queued files gets large - or more
accurately that there is a limit to the amount of data mailq will show
and thus it isn't specifically a message count limit.

On Linux systems I use an inotify enabled kernel (>= 2.6.13) and track
the events via daemon/db. I then query the daemon when I need counts.
You could do similarly on systems that provide an inotify-like feature.

Cheers,
Bill