On Sun, Jan 23, 2022 at 11:08:49PM +0100, Ralph Seichter <ra...@ml.seichter.de> 
wrote:

> Hello Postfix users.
> 
> Hopefully neither Wietse nor you folks will mind me announcing my latest
> software baby here. ;-)
> 
> I have just released version 0.1 of PostQF, a user-friendly Postfix
> queue data filter easily used in Unix-like pipes. For example
> 
>   postqueue -j | postqf -a 90m | wc -l
> 
> prints the number of currently queued messages which arrived during the
> last 90 minutes.
> 
> "Why not use jq?" I hear you ask. While jq is undoubtedly powerful and
> can handle pretty much any JSON data thrown at it, I found jq's syntax
> rather cumbersome. PostQF is specifically designed to make filtering
> Postfix queue data both easier and quicker, by means of simple command
> line arguments.
> 
> If you are interested, please visit one of the following URLs and check
> out more usage examples:
> 
>   GitHub:  https://github.com/rseichter/postqf
>   PyPI:    https://pypi.org/project/postqf/
> 
> I'd appreciate you giving PostQF a good whirl and letting me know what
> you think of it. Enjoy.
> 
> -Ralph

Hi,

Thanks for that. It looks interesting. Something that
struck me is that this would mostly be used with
"postqueue -j | " in front of it. It might be nice to
add an option to cause it to run postqueue -j
internally and read from that, so as to save on command
line typing. But I suppose a shell alias or function
could take care of that without needing to type the
extra option (e.g.: alias postqq='postqueue -j | postqf').

Also, the -a (after) and -b (before) options probably
shouldn't be mutually exclusive. Someone might want to
see messages that arrived between two and three hours
ago, for example.

One last thing, the README.md file recommends
installing into a venv, but it doesn't then explain the
steps necessary to run postqf afterwards. This would be
a mystery to non-Python developers. I'd recommend
adding instructions or a wrapper script for postqf that
gets installed (somehow) into ~/bin that performs the
appropriate setup needed to re-enter the venv and run
postqf. Something like:

  #!/bin/sh
  . ~/postqf/.venv/bin/activate
  exec ~/postqf/.venv/bin/postqf "$@"

cheers,
raf

Reply via email to