Subject: Q about rfc822_parse_msg()

From: "Peter 'Luna' Runestig" <[email-masked]>
Date: Tue, 11 Dec 2001 12:41:02 +0100

Hi all,

When I'm using rfc822_parse_msg() (to parse a raw message from sendmail on
stdin), the created BODY's contents.text.data is always NULL. Is there a way
to make it actually point to the data in the body? contents.text.size is
non-zero.

TIA,
- Peter
----------------------------------------------------------------
Peter 'Luna' Runestig (fd. Altberg), Sweden <[email-masked]>
PGP Key ID: 0xD07BBE13
Fingerprint: 7B5C 1F48 2997 C061 DE4B  42EA CB99 A35C D07B BE13
AOL Instant Messenger Screenname: PRunestig

-- 
------------------------------------------------------------------
 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: Tue, 11 Dec 2001 08:51:33 -0800 (PST)

> to make it actually point to the data in the body? contents.text.size is

The simple answer is "no".

contents.text.data is not an application cell.  It is for the exclusive use of
c-client drivers and upper-level c-client routines, e.g. mail_fetch_????().

The best way to do what you want is to write a c-client driver for stdin, and
then use the higher-level c-client routines.  I realize that this is
difficult, but fighting c-client will probably be more difficult.

---

From: "Peter 'Luna' Runestig" <[email-masked]>
Date: Tue, 11 Dec 2001 18:10:34 +0100

From: "Mark Crispin" <[email-masked]>
> difficult, but fighting c-client will probably be more difficult.

Thanks for the fast response! I think I got it solved now, by reading
contents.text.size number of bytes from (char *)(raw_body_data +
contents.offset). I have tried it with a couple of differently formatted
mails (multi- and singlepart), and it seems to work so far...

Thanks again,
- Peter

---

From: Mark Crispin <[email-masked]>
Date: Tue, 11 Dec 2001 09:41:57 -0800 (Pacific Standard Time)

> mails (multi- and singlepart), and it seems to work so far...

Yes, that works now.  But I can not promise that it will always work in
the future, which is why I don't tell people about that.  So, you need to
be aware and recertify your code against each new release of c-client.

However, I don't have any short-term plans to break that, so for the nonce
you are OK.  I just want to make sure that nobody ever gets the idea that
I have promised that will always work, or get angry with me if it breaks
in a future version.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.