How to delete all email From: a domain or one email address

popowich

EQ Forum Admin
Staff member
Hello,

Do you need to cleanup a postfix mail queue?

To delete all email from one specific email address, or all email From: a specific domain name, please choose the appropriate command from the following list.

To delete all email in the queue from a domain run this command as root:

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

To delete all email in the queue From: a specific email address run this command as root:

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

popowich

EQ Forum Admin
Staff member
To delete ALL email from the queue regardless of domain name or email address use:

postsuper -d ALL
 
Top