Delete messages in Queue

dthompson

Well-Known Member
Nov 23, 2011
146
14
58
Canada
www.digitaltransitions.ca
I would like to know if there is a way to only delete certain messages in a queue en mass.

I have some messages building up in the queue but I don't necessarily want to delete them all, only the ones that I know are dead and will go no where.

Is there anyway for me to granularly delete specific emails stuck in the queue but many of them at once as opposed to deleting all the emails, including the ones I do not want to delete?
 
You can use mailq and postsuper commands for the same. Take a look at - easyengine.io/tutorials/mail/postfix-queue/
 
I would like to know if there is a way to only delete certain messages in a queue en mass.

I have some messages building up in the queue but I don't necessarily want to delete them all, only the ones that I know are dead and will go no where.

Is there anyway for me to granularly delete specific emails stuck in the queue but many of them at once as opposed to deleting all the emails, including the ones I do not want to delete?

You can to try this:

find /var/spool/postfix -type f | xargs -n 1000 grep -l @anydomain.com | sed 's/.*\///g' | postsuper -d -

find /var/spool/postfix -type f | xargs -n 1000 grep -l anyemail@anydomain.com | sed 's/.*\///g' | postsuper -d -

Regards!
 
  • Like
Reactions: Lamaster

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!