Linux – Display number of messages in linux mail queue

emaillinuxqueue

Is there a simple command to find out the current number of messages in the linux mail queue? mailq dumps out a verbose list, but it's not convenient for a quick overview.

I'm using Ubuntu and postfix.

Best Answer

If you just want to know the number of messages sitting in the deferred queue, then the following should get you a quick answer:

find /var/spool/postfix/deferred -type f | wc -l

There are three other queues. See http://www.porcupine.org/postfix/queueing.html for details.