Wietse Venema: > This weekend I added preliminary support for JSON-formatted queue > listings. See below for a fragment from the postqueue manpage. ... > I need to clean up the code and add quoting for control characters > etc. before it can be released.
The code is released as postfix-3.1-20151129, with minor changes. You can find the manpage at http://www.postfix.org/postqueue.1.html The main change since the previous email is that the output is now in the form of one JSON object per queue file, and that each object is followed by newline to support simple streaming parsers. A queue may contain millions of messages, and each message may have a large number of recipients, therefore reading the entire output into memory would not scale. Streaming parsers do not have that problem. So one object looks like: {"queue_name": "active","queue_id": "xxx","arrival_time": 1448908169,"message_size": 3359,"sender": "yyy","recipients": [{"address": "zzz"}]}<newline> Recipients in the deferred queue may also have a "delay_reason" member. I see that there is some unnecessary whitespace. This does not matter for JSON parsers, but I'll fix it anyway. Wietse