The home of William Rendell

Domains in postfix queue

The below command will list the domains in a postfix queue, with the numbers of mails for the domain.

postqueue -p | awk '/^[A-F0-9]/{next} /^[[:space:]]+[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+$/{print $1}' | sed 's/.*@//' | tr '[:upper:]' '[:lower:]' | sort | uniq -c | sort -nr