Re: Is there any documentation on the binary format of the mail files under /var/spool/postfix/ ?

2017-05-29 Thread Hubro
My bad, I had no idea xargs and find could do that. That is extremely cool! -- 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-tp90656p90673.html Sent from the Postfix Users mailing list

Re: Is there any documentation on the binary format of the mail files under /var/spool/postfix/ ?

2017-05-28 Thread Hubro
The problem with that is that you're passing all the mail file paths right in the command line. Say one path is 41 bytes (which they are on my system), filtering 100 000 mails results in 4,1 MB of paths passed to postcat as command line arguments, which is double the limit of my home desktop. Tha

Re: Is there any documentation on the binary format of the mail files under /var/spool/postfix/ ?

2017-05-28 Thread Hubro
The problem with that is that you're passing all the mail file paths right in the command line. Say one path is 41 bytes (which they are on my system), filtering 100 000 mails results in 4,1 MB of paths passed to postcat as command line arguments, which is double the limit of my home desktop. That

Re: Is there any documentation on the binary format of the mail files under /var/spool/postfix/ ?

2017-05-28 Thread Hubro
A postqueue option that listed all queued mails in JSON with some envelope information like sender IP would be amazing... If I had more free time I would consider trying to patch it in as you suggested. But - I think it will be much less work to write a script that feeds large batches of queue IDs

Re: Is there any documentation on the binary format of the mail files under /var/spool/postfix/ ?

2017-05-28 Thread Hubro
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 d

Re: Is there any documentation on the binary format of the mail files under /var/spool/postfix/ ?

2017-05-28 Thread Hubro
Wietse Venema wrote > That information is already available from the Postfix maillog file. My first attempt at solving this actually relied on going through the log file to find the client IP, but I found out that the line containing "client=..." was frequently missing. If I grep the log file for

Is there any documentation on the binary format of the mail files under /var/spool/postfix/ ?

2017-05-28 Thread Hubro
Posfix keeps mails in a binary format in folders under /var/spool/postfix, at least by default. I want to write some tools for searching and filtering by the meta data of a large number (hundreds of thousands) of emails under /var/spool/postfix/deferred. Among other things, I want to find all queu