Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

12 views
Skip to first unread message

tomas...@gmail.com

unread,
May 28, 2017, 4:11:14 AM5/28/17
to
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 queue IDs of mails sent from specific IP adresses so that they can be deleted.

I'm having some problems understanding the binary format of the files though. It seems that the envelope records starts with the bytes "\x41\x16" and ends at the bytes "\x4d\x00". The records are separated by two bytes, the first of which is "\x41" and the second of which varies, and I don't understand the logic behind it.

Is the binary format of these files documented anywhere? I have searched for quite a while with no luck.

Also, is the binary format of these files *stable*? As in, does the format change depending on which Postfix version created them?

Any information related to the binary format of these files would be greatly appreciated.

---

NB: I want to write my own tools for this partly for learning and fun, but also because tools like "postqueue" and "postcat" are just WAY too slow when we're talking about hundreds of thousands of mails, which some times happens when users of my mail servers get infected by spam scripts.
0 new messages