[Dovecot] Question about IMAP
Timo Sirainen
tss at iki.fi
Sun May 17 19:26:21 EEST 2009
On May 17, 2009, at 11:18 AM, Charles Marcus wrote:
> My question is:
>
> Using the IMAP protocol, is there a way, *without* downloading the
> entire message (specifically, binary attachments), that an IMAP client
> can do the following:
Yes. There are even several different ways to do it. Everything starts
by doing FETCH BODYSTRUCTURE command, which gives the client knowledge
of what MIME parts the message contains and also all the MIME headers.
After that it can fetch only those parts it's interested in.
> 1. Download *only* the message headers and the text/html/body contents
> of the body of the message but *not* any binary attachments,
BODYSTRUCTURE shows Content-Type of each MIME part. After that client
can do e.g. FETCH (BODY[1]) to fetch only the first MIME part.
> 2. Detect that a message *has* one or more binary attachments,
> *without*
> downloading them,
>
> 3. Grab the names of all of the attachments,
BODYSTRUCTURE should have all that information. If there's something
missing, it's still possible to do FETCH BODY[n.MIME] to get MIME part
headers.
> 4. Display for the user the email/email headers and text/html body
> parts,
I'm not sure what you mean by this.
> 5. Display the existence of the attachments in whatever manner the
> client normally shows them (in TBird, they show at the bottom of the
> message just above the status bar),
Yeah. The only issue I can think of here is if TB wants to detect the
attachment type by e.g. feeding the file to "file" command or
something. But even then it would be possible to download for example
first and last 1 kB of the attachment and hopefully file would
recognize the type based on only those.
> 6. Download the actual attachment on demand - ie, if/when it is
> dbl-click > opened, right-click > saved, or the message is forwarded?
Yes.
> Pointers to appropriate IMAP protocol docs would be happily passed
> on to
> them the Mozilla dev guys.
It's all in RFC 3501 in FETCH command docs.
BTW. There are many clients that do this on-demand downloading. I use
Apple Mail and Evolution and they both do it.
More information about the dovecot
mailing list