On Thu, Aug 26, 2021 at 01:16:25PM -0700, Matt Corallo wrote:

> I’m not particularly worried about congestion on this server, but maybe delay 
> is the wrong warning to focus on - I’d like postmaster notifications for some 
> temporary bounces, as they can indicate IP reputation rate-limits, which I’d 
> love to learn about.
> 
> Sure, I could write something that parses the smtp logs, but it’d be nice not 
> to have to.

You can start with something like:

    $ postqueue -j |
        jq --argjson now "$(date +%s)" '
            ($now - .arrival_time) as $delay |
            select (.queue_name == "deferred" and $delay > 300) |
            .delay = $delay
            '

And augment the "jq" script to suit your needs.  If you prefer
Python to "jq", process the results in Python.  The input stream
is one JSON object per line...

-- 
    Viktor.

Reply via email to