Subject: Re: Body Parts Revisited

From: "J. T. Breitner" <[email-masked]>
Date: Mon, 6 Sep 1999 18:47:19 -0400 (EDT)

> Is there a way to see encoding type and other 
> data on this body section with that call, or is parsing the 
entire 
> message required? 
After mail_fetch_structure(stream, SeqNum, &Body, NIL) you have 
everything in cache, so Body->type, Body->subtype etc. are at 
your service. See body in mail.h for details. Message text fields 
in Body are empty after this - you're fetching message structure 
only. 
Yes, mail_fetch_structure fetches all headers of all (sub)parts 
so in this sense it fetches the whole message (no bodies, of 
course), but it can't be done otherwise

That's what I've been doing, grabbing the structure.  But it's a hassle
to index down through the various parts to get to the where I need
to be.

Oh well, always searching for an easier way.

Thanks...

Jeff

---

From: Mark Crispin <[email-masked]>
Date: Mon, 6 Sep 1999 23:37:44 -0700 (PDT)

> Oh well, always searching for an easier way.

Since structures can nest, you have to get the entire body structure.
Otherwise, you wouldn't have a clue as to what body part section specifiers
you can use, except by some mechanism to do it one at a time.

But doing it one at a time would involve a round trip for each body part.
That would result in a clunky (and slow!) client.  In other words, there's no
good reason for such a feature to exist.  It may seem otherwise at first, but
if you think it through, you'll see that what appears to be "easy" on the
surface is really a bad idea.

There's usually a good reason why things were done the way they were (although
there are a few mistakes...).  It's not always obvious -- especially if you're
just starting -- why some things were done that way.  But please feel free to
keep on asking.  Remember, the only "stupid question" is the one that isn't
asked!