|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Wietse Venema (wietse
porcupine.org)
Date: Tue Apr 15 2008 - 07:56:56 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Ralf Hildebrandt:
> I can't, for the life of it, find the little script that allows me to
> delete mails from the queue, based on the queuefile's content.
>
> Care to share?
First, make sure that your pattern expression is good:
find /var/spool/postfix/whatever -type f -print | while read name
do
postcat $name | grep 'pattern' | sed "s;^;$name:;"
done
Once you're satisfied that your pattern is good,
find /var/spool/postfix/whatever -type f -print | while read name
do
postcat $name | (grep -q 'pattern' && echo $name)
done | xargs rm
If this is a busy system, you may want to rename the bad files to
the hold queue first:
find /var/spool/postfix/whatever -type f -print | while read name
do
postcat $name | (grep -q 'pattern' && mv $name /var/spool/postfix/hold)
done
Wietse
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]