How do I count the messages of Postfix's mailq?
I use this:
mailq | grep -c "^[A-F0-9]"
You can pipe the output of mailq
through various other filters such as uniq
, sort
and wc
to get other statistics.
either mailq | tail -n 1
or find /var/spool/postfix/deferred -type f | wc -l
both works