This is a quick and dirty guide to the postfix queue - which handles mail which is queued for delivery but not sent (as yet).
To see what's in the queue, issue this command:
which produces output similar to this:
5642B4D8647* 1683500 Tue Jun 3 08:37:27 email@example.com firstname.lastname@example.org 9359B4D82B1* 1635730 Tue Jun 3 08:36:53 email@example.com firstname.lastname@example.org
To force a flush of the queue (basically, try to send eveything in the queue) issue the command:
You can also use the message ID (the first number in the queue list entries) to specify that mail to be deleted with the
postsuper command. For example:
postsuper -d 5642B4D8647
If you have a list of message ids in a file (one per line) to delete, then a simple script can be written:
#!/bin/bash input="/path/to/file" while IFS= read -r var do postsuper -d $var done < "$input"
Finally to delete all deferred messages:
postsuper -d deferred