Pages

Welcome to My Blog

This is to share my IT experience with friends all around the world.
I have been working in Linux Fedora Systems for more than 8 years. Its fun to share knowledge and learn..
As everyone knows when a problem arises in your systems "googling" is the way that many depend on..

All the posts here are my working experiences during my working life.. So you can count on it..

I have added the references where I got help in solving IT issues


Wednesday, September 14, 2016

Deleting active mails in the mailq in Postfix

There are several scripts to do that, but I found most of them are not clearing the active queued messages as the mail ids contain '*' at the end of the ID field. I have used cut -n to get the exact mail ID and delete them.

Following given command will delete mails from/to 'testuser@test.com' from the queue:

postqueue -p | grep "testuser@test.com" | cut -f 1 -d ' ' | cut -c-10 | xargs -n 1 postsuper -d








Following referrences are worth to read:

http://www.postfix.org/postsuper.1.html



http://www.bstar.de/2014/07/08/how-delete-single-mails-from-the-mail-queue-of-postfix-plesk/