doveadm fetch line wrapping

Peter Chiochetti pch at myzel.net
Mon Sep 28 11:03:55 UTC 2015


The manual at http://wiki2.dovecot.org/Tools/Doveadm/Deduplicate
tells how to estimate what will be expunged:

> doveadm -f table fetch -u jane 'guid uid' mailbox a_Box | sort

I wanted to learn the subjects:

> doveadm -f table fetch -u jane 'guid hdr.Subject' mailbox a_Box

In the output, long lines will be broken up, continuation lines starting 
with a blank (mostly), disabling the sort

> doveadm -f table fetch -u jane 'guid hdr.Subject' mailbox a_Box \
>  | sed -e :a -e '$!N;s/\n\s//;ta' -e 'P;D' | sort --stable

Some (gnu) sed foo joins them back together, the sort works again :)

-- 
peter


More information about the dovecot mailing list