How to count / determine the exact amount of messages in a Postfix mail queue

How do I count the message in Postfix’s mail queue? I’m not really interested in all these posts on the internet that outputs the queue. If I’m spammed this just freezes my console. I just want the number of messages in the queue.

To re-iterate: The normal commands output all the messages. I just want to know how many messages there are.

The solution is to do this:

mailq | grep -c "^[A-F0-9]"



Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top