How can I get number of messages count in Postfix's mailq?
mailq command display entire mails in mailq but i would like to know count only.Is there any command for this. My OS is centos 5.5.
mailq | grep -c "^$"
This is essentially the same as @Ladadadada's answer of:
mailq | grep -c "^[A-F0-9]"
Except I am just looking for the empty lines which follow each message entry in the mailq log, rather than something that looks like the start of a valid message-ID. It is therefore better performance-wise, although the difference is only noticeable on very a-typical mailq log sizes.