1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)

Postfix Delete All Email Messages Linux Commands

POSTFIX-DELETE-EMAIL-MESSAGES

If you are running your own mail server you may need to delete messages. If you would like to delete them all use this command. you must be logged in as root.

postsuper -d ALL

 

The next command will let you delete all email in the queue that is from a certain domain. You will have to be logged in as root.

postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } /@example\.com/ { print 1 }' | tr -d '*!' | postsuper -d -

 

If you only want to delete emails from a specific email address run this command. Make sure you are logged in as root.

postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } /username@example\.com/ { print 1 }' | tr -d '*!' | postsuper -d -

 

This last linux command works to delete a single message:

postuper -d 070788B31

 

CLICK HERE to see our full Postfix Cheat Sheet using linux commands.

Summary
Postfix Delete All Email Messages Linux Commands
Article Name
Postfix Delete All Email Messages Linux Commands
Description
Using Linux commands to delete email messages with Postfix.
Author
A1WebsitePro

Related Post

Postfix Delete All Email Messages Linux Commands was last modified: October 6th, 2017 by Maximus Mccullough

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider buying me a drink.

Drinks

Leave a Reply

Your email address will not be published. Required fields are marked *