after rfc822_parse_msg when I try to ouput the envelope and body contents I get this:
What do you mean by "body contents"?
If you are talking about body->contents.text, that is not something that is set by rfc822_parse_msg(). In fact, that is not something that you should *ever* access in your application; it is strictly internal to c-client.
That's why I suggest that you use the higher-level routines. If the message is truly in a non-mailbox form, you are better off writing a driver for it than calling rfc822_parse_msg() directly. Perhaps you can start by hacking the phile driver using the message loading capability from the mh driver.
The proper use of rfc822_parse_msg() is very complicated, and only a careful study of mail.c will show you this. Fortunately, mail.c will do the work for you, if you have a driver.
-- Mark --
http://staff.washington.edu/mrc Science does not emerge from voting, party politics, or public debate. Si vis pacem, para bellum.