On Tue, Sep 08, 2015 at 10:13:30AM +0200, Patrick Ben Koetter wrote:
> At the moment I need to know the top senders in a mail queue with more than 2
> million messages. I'd rather not dig in the logs, but use Postfix internal
> knowledge about messages currently in queue.
A log analyzer that checkpoints its state, and incrementally updates
it from just the new log entries would be far more efficient than
a queue file reader. Especially if you just need to track "top
senders".
> > But i think you're looking for more detailed stats.
>
> Nope. I'm looking for a (more) machine readable format.
Wietse's comment about JSON is what I would suggest for a
machine-readable queue content report, but running that report
frequently on a busy queue is not a good idea. This takes too many
I/O cycles away from useful work.
Efficient queue scans also require keeping state from previous
scans (and use of "long" queue-ids), so that you don't need to
re-read queue-files you've already read (if all you really care
about is the sender anddress and not the number of outstanding
recipients to deliver) or log entries you've already read.
I still recommend using the logs to incrementally update a model
of the queue content (with some heuristics to drop implausibly old
messages whose log entries might have been lost).
--
Viktor.