Hi Timo, I have a question that you can maybe answer off the top of your head, considering your vast knowledge of the IMAP protocol... There is a Thunderbird bug that is near and dear to my heart, that is trying to address how Thunderbird deals with large messages (ie, messages with large attachments). Current behavior sucks... it downloads the entire message every time the message is clicked on. 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: 1. Download *only* the message headers and the text/html/body contents of the body of the message but *not* any binary attachments, 2. Detect that a message *has* one or more binary attachments, *without* downloading them, 3. Grab the names of all of the attachments, 4. Display for the user the email/email headers and text/html body parts, 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), 6. Download the actual attachment on demand - ie, if/when it is dbl-click > opened, right-click > saved, or the message is forwarded? Pointers to appropriate IMAP protocol docs would be happily passed on to them the Mozilla dev guys. Thanks! -- Best regards, Charles
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.
Reasonably Related Threads
- [PATCH] lib-imap: imap-bodystructure: add test with empty header field
- OT: Looking for a robust IMAP client
- Dovecot/IMP Bug with RFC822.SIZE and BODYSTRUCTURE
- Auto creating client folders on the IMAP server after installing client.
- RFC 3501 violation in FETCH BODY responses