Postfix Email Queue Management

postfix-managementThis post explains your Postfix Email Queue Management commands, another post on this blog explains how to delete or selectively delete from the postfix queue

1- Display a list of queued mail, deferred and pending



postqueue -p

To save the output to a text file you can run

mailq > myfile.txt


postqueue -p > myfile.txt

the above commands display all queued messages (Not the message itself but the sender and recipients and ID), The ID is particularly useful if you want to inspect the message itself.

2- View message (contents, header and body) in Postfix queue

Assuming the message has the ID XXXXXXX (you can see the ID form the QUEUE)

postcat -vq XXXXXXXXXX

Or to save it in a file

postcat -vq XXXXXXXXXX > themessage.txt

3- Tell Postfix to process the Queue now

postqueue -f


postfix flush

4- Delete queued mail/
Delete all queued mail

postsuper -d ALL

Delete differed mail queue messages

postsuper -d ALL deferred