On Wed, Feb 04, 2009 at 10:25:21AM +0200, Marc Silver wrote: > > The tool is available at http://draenor.org/public/python/pqgrep.py > Should you find any bugs/problems, please mail me.
The regexp parser is IMHO too fuzzy for production use outside your own environment. It will generated false positives with sufficiently interesting remote error messages, sender or recipient addresses in the "postqueue -p" output. You need a more context aware parser. > Some examples: > > o List the message ID's for messages with a sender off x...@moo.com: > pqgrep.py -s x...@moo.com -i Note, it is best to not call a "queue-id" a "message ID". > o Show messages with a recipient of a...@b.c and provide log messages: > pqgrep.py -r a...@b.c -l > > o Delete all messages from MAILER-DAEMON: > for i in `pqgrep.py -s MAILER-DAEMON` ; do postsuper -d $i ; done This is subject to race conditions. To safely delete messages, they have to moved (postsuper -h) out of the "active" queue, re-scanned to ensure they still meet the original criteria, selectively deleted, and the FPs moved back into the deferred queue (via postsuper -H), you can then flush FPs back into the incoming queue via "postqueue -i". [ Wietse is it safe to move queue files active -> hold -> incoming in a short time? Could some recipients be delivered twice by two delivery agents in parallel (both deliveries starting after the second incoming to active transition)? ] -- Viktor. Disclaimer: off-list followups get on-list replies or get ignored. Please do not ignore the "Reply-To" header. To unsubscribe from the postfix-users list, visit http://www.postfix.org/lists.html or click the link below: <mailto:majord...@postfix.org?body=unsubscribe%20postfix-users> If my response solves your problem, the best way to thank me is to not send an "it worked, thanks" follow-up. If you must respond, please put "It worked, thanks" in the "Subject" so I can delete these quickly.