> On Aug 26, 2021, at 13:29, Viktor Dukhovni <postfix-us...@dukhovni.org> wrote:
> 
> 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...


I take that as a “no, there is no built-in way to do this”. Allow me to suggest 
“postmaster-only warnings” as a feature request, protocol, delay, or whatever 
makes sense :).

Thanks for the script, I’ll cron something for now :).

Reply via email to