find the count of messages in Postfix’s mailq

 

You can pipe the output of mailq through various other filters but simply you can do this

# mailq | tail -1

 

or this

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