Here are a few of my most used postfix commands for managing the mail queue.
- Check how many emails are in the queue per domain (based on from address)
postqueue -p | grep "Aug" | awk '{print $7}' | sed 's/^.*@//' | sort | uniq -c | sort -n
- List all the email from a particular domain
mailq | grep $domain
- Delete all email from a specific domain
mailq | grep $domain | awk '{print $1}' | postsuper -d -
- Read a specific email in the queue
postcat -q $id
(the $id number is the number that was listed when you brought up a list of email)
- Search for the authenticated username in a specific email
postcat -q $ID | grep Auth