[Dovecot] doveadm fetch

Steffen Kaiser skdovecot at smail.inf.fh-brs.de
Wed Apr 21 10:26:22 EEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue, 20 Apr 2010, Timo Sirainen wrote:

> doveadm fetch INBOX "flags uid hdr.received hdr.from body" all
>
> would look like:
>
> ===sep
> flags: \seen \draft $Label1
> uid: 1234
> hdr:
> Received: stuff
> Received: more stuff
> From: tss at iki.fi
>
> body:
> message body
> ..
> ===sep
> flags: ..next message..
> ===sep
>
> The ===sep is a randomly generated separator string that begins always
> with "===", optionally it could be given as parameter. I was wondering
> about how to return hdr.* fields, if they should be returned separately
> or all in one "hdr". Otherwise separate fields would be nice, but if the
> header exists multiple times, it's not so clear anymore how it should be
> written. So if there's a single hdr then it's at least easy to

I would output the headers the same way they are in the message, maybe an 
option to unfold lines.

> understand that it ends with an empty line.

How about LDIF-like syntax:

<tag>: <text>
<tag>: <text>
  continued line

So:

flags: \seen \draft $Label1
uid: 1234
hdr: Received: stuff
hdr: Received: more stuff
hdr: From: tss at iki.fi
  continued line of From:
body: line 1 (8bit probably encoded??)
  line 2
  line 3
<<really blank line separating items>>

> It would be nice also to support something like:
>
> doveadm search INBOX from tss at iki.fi
>
> doveadm next|less
> doveadm next|less

I would agree with Nikita to not use this scheme, but something you can 
parse easily and put into a loop, say

doveadm search INBOX from me at example.com | while read uid trail; do
   doveadm fetch "$uid"
done

> though. Would be nice if it was terminal-specific, and would be nice if
> it didn't write any temporary files.

;-)

Regards,

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBS86oob+Vh58GPL/cAQLqgAf/futnHtRQxPBKnutd8mJmbmoSppAGqXpv
QRBUkOlP+ynANuL5iL6KSYMsIcZQols5KKTRmzddX+cMu+Jo8F5pU5XjkfGJ7fYt
BDVY/Of1Bxm6WoPyHK12EQaO0+X3IJw8b8jH3e4TEQi3Se0TUCJvP1q04/0HqUFp
bIWBs6a4ZJTqzNrZ0A9Sr6jKBYAelCpPOlhRZ9jDHkvqlbKDcXaalQxVtPpbHNsX
BM363MSxkwLr7wWpRCdaeAebsYWKRz0WpxQEOb7yX6/+Rqekkh7czzlafAEjR7TJ
zgxkvImCYeC600R4J7Q/11msqgQPIpIMNwIP+jkyFNrfdTaQPoSOZw==
=PzpF
-----END PGP SIGNATURE-----


More information about the dovecot mailing list