This is an old revision of the document!
Postfix queue statistics for Cacti
/usr/local/bin/getmailq.sh
#!/bin/bash
QUEUES="incoming active deferred hold"
for i in $QUEUES; do
COUNT=`qshape $i | grep TOTAL | awk '{print $2}'`
result="${result} $i:$COUNT "
done
echo $result