bug: some table header(?) output goes to stderr instead of stdout

Joseph Tam jtam.home at gmail.com
Fri Mar 19 00:32:24 EET 2021


On 2021-03-18, Marc <Marc at f1-outsourcing.eu> wrote:

> [@ sbin]# doveadm -f table -o mail_location=mdbox_deleted:/home/popusers/testtest/mdbox:INDEX=/home/popindex/testtest/index fetch -u testtest 'guid' mailbox INBOX 2> /dev/null
> 3c967f33b8aea671f3551db1ea8e33e9
> 6fa01ccc103a7009c7b940657dbcd72c
> ba955a6d6218950f42e5b0ee0a33a916

Strange -- my version (2.3.10) dumps headers to stdout, not stderr

 	# doveadm -f table fetch -u $user guid mailbox INBOX 2>/dev/null | cat -n | head -3
 	1  guid
 	2  8104226179c70d7cc248c9924cabdb8c
 	3  0813554a7ed4cf1e113f42a4cc8bc477

>From a strictly design point of view, this seems more correct as the
header is part of the data, not "out of band" output like errors.  If headers
are pumped to stderr, you can always employ shell hacks (as a followup poster
did) to unify them to stdout

 	# doveadm -f table fetch ... 2>&1

Maybe it's better to add another formatter to avoid tricky parsing
or shell hacks e.g.

 	# doveadm -f tab-nohdr ...

Joseph Tam <jtam.home at gmail.com>


More information about the dovecot mailing list