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]"
Reference:
https://serverfault.com/questions/481038/how-do-i-count-the-messages-of-postfixs-mailq