Some tips for working with Postfix on your VPS or dedicated server hosted with Beecher Networks.
Postfix Queues
Postfix maintains two queues, the pending mails queue, and the deferred mail queue. The deffered mail queue has the mail that has soft-fail and should be retried. Postfix retries the deferred queue on set intervals (configurable, and by default 5 minutes)
Display a list of queued mail, deferred and pending
These commands display the sender, recipients and ID of all messages in the queue. The ID is particularly useful if you want to inspect the message itself.
mailq
or
postqueue -p
To save the output to a text file you can run
mailq > myfile.txt
or
postqueue -p > myfile.txt
View Message Contents In Queue
Assuming the message has the ID XXXXXXX (you can see the ID form the QUEUE)
postcat -vq XXXXXXXXXX
Process Queue
postqueue -f
OR
postfix flush
Delete Queued Mail
Delete All
postsuper -d ALL
Delete Deffered
postsuper -d ALL deferred