Ever wondered how to delete a specific email in a postfix queue
- Angelo Schalley
- Jul, 26, 2017
- Plesk Linux, Postfix
- No Comments
I was looking for an easy way to delete a specific email in a postfix queue on a redhat/centos environment.
Well this is what I found and it worked like a charm 🙂
mailq | tail -n +2 | awk ‘BEGIN { RS = “” } / root@linix\.eu$/ { print $1 }’ | tr -d ‘*!’ | postsuper -d –
This will delete all email coming from root@linix.eu or send to root@linix.eu and will leave the rest of the mails in the queue.
check again with
postqueue -p or mailq