Re: New mailbox interface and gmime messages

On Sat, 01 Mar 2003 00:56:34 Carlos Morgado wrote:
> On Fri, 28 Feb 2003 22:40:28 Magick wrote:
> > So there should be a function to retrief header(s) of all the messages
> > in
> > a mailbox, and a function to get a set of headers of a message.
> > And of course a function to get all of the message text, are there
> > other
> > places that need special handling?
> it goes pretty much like this, you scan the mailbox and that gets you a
> list
> of messages. gmime Message includes from, recipients, subject and date.
> you can also get arbitrary headers from an hash gmime creates while it's
> scanning the message, we can cache those we need for threading.

You can just let gmime cache the headers, it is already doing that. But 
don't think about how to implement it, think about what you want to do 
with it.

> at this moment i'm not sure if we should have libbalsa_message_get_header
> specific function or if we should just go ahead and peek at gmime
> structures - much like we do with libmutt now at some points.
> i'm pending towards macros such as
> SUBJECT(message)
> this can be expanded to message.subject or message.gmime.subject
> or libbalsa_message_get_subject - whatever we need now or in the
> future.

You can always name the macro libbalsa_message_get_subject...

> please note you always have to scan the full header while reading
> in the mailbox so you get all the headers for free. the access penalty
> for local stores or even nfs is negligable
> in the imap case you can ask the server for specific headers, or
> read in the header in bulk - which is better, depends :)

The local case is easy, just use lots of memory and cpu :-)
I was thinking about the imap case, you could get a selected set of the 
headers with, for example, the FETCH command. So when doing threading you 
first fetch all the 'message-id', 'references' and 'in-reply-to' headers, 
use that to build a threaded tree, and than fetch only for the messages in 
view the 'subject', 'date', etc headers.
So if you want to minimize the bandwidth used for imap you should request 
the absolute minimum at the display part. How the mailbox and message part 
handles it, is not the consern of the display part, it should just ask the 
message/mailbox where you can do a lot of smart things.

Reread my message with the above in mind, I think it will be much clearer.

When a guy says "the last thing I'd wanna do is hurt you" it just means 
he's gotta do other things first.
Fingerprint = CD4D 5601 287D F075 6F96  6157 99F9 E56A 4B08 6D06

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]