doveadm fetch line wrapping
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
On 28 Sep 2015, at 14:03, Peter Chiochetti <pch@myzel.net> wrote:
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 --stableSome (gnu) sed foo joins them back together, the sort works again :)
I think this would work too:
doveadm -f table fetch -u jane 'guid hdr.Subject.utf8' mailbox a_Box | sort
Am 2015-09-28 um 14:03 schrieb Timo Sirainen:
On 28 Sep 2015, at 14:03, Peter Chiochetti <pch@myzel.net> wrote:
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 --stableSome (gnu) sed foo joins them back together, the sort works again :)
I think this would work too:
doveadm -f table fetch -u jane 'guid hdr.Subject.utf8' mailbox a_Box | sort
Indeed, that works, and the result is much easier to read. Thank You a lot for the tip!
PS: Does mail_plugins mail_log mail_log_fiels also support this chaining of decoder? If not, a feature wished for… Gonna try tomorrow or next week ;)
-- peter
On 28 Sep 2015, at 23:35, Peter Chiochetti <pch@myzel.net> wrote:
doveadm -f table fetch -u jane 'guid hdr.Subject.utf8' mailbox a_Box | sort
Indeed, that works, and the result is much easier to read. Thank You a lot for the tip!
PS: Does mail_plugins mail_log mail_log_fiels also support this chaining of decoder? If not, a feature wished for… Gonna try tomorrow or next week ;)
No, but I think it should be changed to do that always.. That would be a v2.3 change though.
participants (2)
-
Peter Chiochetti
-
Timo Sirainen