Hi, I see you have gotten plenty of good responses, but here is how I deal with 
it.
Once I know what I am looking for.... from the command line I do this, and it 
is pretty fast for 1 to 2 thousand emails at a time.

These are some recent examples I used to clean things up, that were sitting 
there for days already.

HOLD queue:
postqueue -p|grep match.com|awk '{print $1}'|sed -r 's/!//'|while read id; do 
postsuper -d $id;done

Deferred queue:
postqueue -p|grep MAILER|awk '{print $1}'|while read id; do  postsuper -d 
$id;done



-Angelo Fazzina
Operating Systems Programmer / Analyst 
University of Connecticut,  UITS, SSG, Server Systems
860-486-9075

-----Original Message-----
From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] 
On Behalf Of Hubro
Sent: Sunday, May 28, 2017 7:07 PM
To: postfix-users@postfix.org
Subject: Re: Is there any documentation on the binary format of the mail files 
under /var/spool/postfix/ ?

I have already made similar scripts, but the issue is that it runs "postcat"
and "postsuper" once for every queue ID, so it becomes absolutely unusable
when needing to delete tens- or hundreds of thousands of emails.

So far I have been lucky in that most of spam scripts send mail with only a
few different sender email addresses, so I've been able to grep the output
of "postqueue -p" 4-5 times, used Vim to create a long list of queue IDs and
fed it to "postsuper -d -" through the standard input.

However, I'm never sure I've caught all the spam mails sent from the
specific IP, and some day I could have to clean up the spam of a script that
generates random sender email addresses. That day I'm going to need a fast
script that can filter queue IDs by sender IP.

I really, really wish "postcat -e" had a "-" option, like postsuper, that
allowed me to stream queue IDs in through stdin...



--
View this message in context: 
http://postfix.1071664.n5.nabble.com/Is-there-any-documentation-on-the-binary-format-of-the-mail-files-under-var-spool-postfix-tp90656p90662.html
Sent from the Postfix Users mailing list archive at Nabble.com.

Reply via email to