Re: message list retrieval

DINH Viet Hoa <[email protected]>
Newsgroups gmane.mail.libetpan.user
Message-ID <etPan.425401b3.46b6af3.d8f@utopia>
Luke Ehresman wrote :

> Thanks for all your help so far, I really appreciate it as I'm getting
> up to speed with using this library.

no problem.

> I have another question.  What information is initially retrieved for
> each message when I do a mailfolder_get_messages_list() call?  All I
> want is the list of UID's in a folder, and I want to fetch the header
> information manually.  Basically, I am implementing paging so I only
> want to retrieve a set of 30 headers at a time rather than everything.

First, to answer your question, mailmessage_list will only return a list 
of message with mainly the uid of the messages. The headers won't be 
retrieved.

What you can do is to split the returned mailmessage_list into several 
(you have to build up the mailmessage_list yourself) and use 
mailmessage_get_envelope_list() things.

> The c-client library had a function that would return an array of uid's
> given a folder and a method for sorting them.  I think in a previous
> thread we established that libetpan doesn't do sorting yet, but still
> retriving only a list of uids (or as little information as possible)
> would be useful.

If you fetch the headers using mailmessage_get_envelope_list(), you 
could do the sorting (but you need to provide a custom function to 
choose the kind of sorting). Fetching headers in IMAP using the 
mailmessage_get_envelope() should be fast enough on most servers.
That does not do a FETCH request for each message. That will fetch the 
(IMAP) ENVELOPE in one request, which is optimized (or can be optimized) 
on most IMAP servers.

-- 
DINH V. Hoa,

"oh là, doucement bijou" -- nico
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBCVATz7w+pfAWHa3MRApa0AJ9jIGv8fTLaO0YEPeMlWvQyQ2W6qgCeM1zb
4aQMWUUmhSFItrXEXMkup4w=
=38PP
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.