Subject: An efficient partial body fetch

From: "Rubinstein, Dmitry" <[email-masked]>
Date: Tue, 16 Mar 1999 14:55:17 +0200

Hi!

The IMAP allows fetching a partial fetch of a body part:

A001 FETCH 1 BODY[1]<0.2048>

will retrieve the first 2048 of the body part 1.

This mechanism is implemented in the UW IMAPd, but not reflected in the
c-client interfaces. This renders the otherwise useful feature of partial
retrieval useless in certain situations. Consider, for example, the
following scenario (it is very close to what I have to deal with): an IMAP
server over an IMAP mailbox driver. The user issues a request for partial
body retrieval. The underlying storage (IMAP) is capable of processing this
request efficiently, however the lack of suitable interface makes it
impossible to take advantage of the underlying storage capability: the
mailbox driver will fetch the whole body part and pass it on to the
application, which will return the requested piece to the client, while
dumping the rest.

What I'd like to have is the ability to have 'pipelining'. That is, to start
passing on to the client the information retrieved from the remote mailbox
while that information is still being retrieved. 

Mark, is it planned to have an addition to the mailbox driver and c-client
interfaces, that will allow such pipelining? How hard it is to make such an
addition? Has anyone else felt a need for such feature?

--
Dmitry Rubinstein  <*>

Home: (972)-8-8647229
Cell: (972)-53-428979
[email-masked]
http://www.wisdom.weizmann.ac.il/~dimrub
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Tue, 16 Mar 1999 09:39:45 -0800 (PST)

> while that information is still being retrieved.

This is the first time that anyone has made this request.  In most cases,
imapd access a local mailbox file.

It's a reasonable request.  Unfortunately the straightforward implementation
would be an exceedingly poor performer.  imapd has special code to do
successive partial fetches of the same text efficiently.  imapd remembers the
last text used by a partial fetch, and reuses that text for another partial
fetch on the same text.

In effect, imapd sacrifices the ability to pipeline itself in order to offer
pipelining to the IMAP client.  I'm sure that you'll agree that this was the
correct trade-off.

It would probably be a lot of work in order to do this without requiring such
a trade-off.  I don't have any plans to do it.  I'd be willing to give you
some advice if you want to undertake it yourself, but I suspect that when you
see what's involved you'll become as reluctant as me.