Tagged: postfix

Postfix Flush Deferred Email Queue

Some people try to test out an application, a site, a contact form and may use an email like hello@test.com that would never be delivered by the local email delivery system and would be in the queue forever, or until it is deleted.

Here’s a trick to delete such emails from postfix. Similar commands may be available with other similar tools too.

# to see the mail queue
postqueue -p
# to delete all the deferred emails
postsuper -d ALL deferred

# verify that queue is empty
postqueue -p
# for more info, check out the *man* pages of these commands