Subject: POP3 caching?

From: Karsten Ballueder <[email-masked]>
Date: Mon, 22 Feb 1999 15:16:05 +0000 (GMT)

Hello,
I have another two questions about how to use the c-client
library.
I found that when I call mail_fetchstructure() of
mail_fetchfast() on a POP3 connection, it would download
all complete messages, not just the headers. Then, when I 
retrieve the text of a message, it would get downloaded again.
>From the docs I understood that there was some kind of cache
mechanism. Do I need to explicitly enable this? How can I do
that? Like it is now, POP is _very_ slow. (Doesn't happen on 
IMAP connections.)

The other question is whether there is anything like mail_elt() 
which would take not a sequence number but a uid as argument?

Also, I found that mm_status() would sometimes get called with a
stream argument different from the one used to call the c-client
code (imap4r1.c allocates a new stream in some cases, a short comment
there mentions it). Unfortunately also the mailbox path parameter is
different from the original one, as something like
{localhost/user=xxx}/mypath would get changed to
{my.host.com:143/user=xxx}/mypath
which makes it difficult to find out for which stream mm_status() got
called, especially in a multithreaded environment. 
(This is not too big a problem for me, but maybe it could be improved
in a future release?)

PS: Thanks for the reply about my message/rfc822 forwarding problem! I
must have done something wrong before, it works perfectly now.
--
 Karsten Ballüder http://www.phy.hw.ac.uk/~karsten/ mailto:[email-masked]
 Physics Department, Heriot-Watt University, Edinburgh, EH14 4AS, Scotland
                     Tel. +44-(0)-131-4513068  Fax. +44-(0)-131-4513136
           "In a world without fences, who needs Gates?"  

-- 
------------------------------------------------------------------
 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: Mon, 22 Feb 1999 09:38:02 -0800 (PST)

On Mon, 22 Feb 1999 15:16:05 +0000 (GMT), Karsten Ballueder wrote:
> all complete messages, not just the headers.

That's because that's the only way to get the correct RFC822 size.  Many POP
servers give the wrong information in the LIST command (they give the size
with bare-LF newlines instead of CRLF newlines).  Also, if you fetch MIME
data, this is the only way to get the MIME information..

> Then, when I
> that?

The data is cached.  This can be verified by running mtest, answering "Y" to
"Debug protocol", opening a POP inbox, doing "H ALL" (which calls
mail_fetchstructure()) and then typing any message.  You'll see that the
message data isn't fetched again.

By any chance, are you calling mail_gc()?  If so, there's your mistake.

> Like it is now, POP is _very_ slow. (Doesn't happen on
> IMAP connections.)

POP is very poor.  That's why POP is obsolete, and you should concern yourself
with IMAP instead.

> which would take not a sequence number but a uid as argument?

mail_msgno() converts a UID into a sequence number or indicates that the UID
is invalid.  You can then feed that valid sequence number into mail_elt().