[Tutor] using 'mailbox'

Sheila King sheila@thinkspot.net
Fri, 07 Sep 2001 11:24:17 -0700


On Fri, 7 Sep 2001 14:09:19 -0400, Rick Pasotto <rick@niof.net>  wrote
about [Tutor] using 'mailbox':

:What am I overlooking? I have a file in unix mailbox format that I would
:like to process by changing the body of each message. Using the mailbox
:module I can get and deal with the headers but I'm not seeing how to
:deal with the body.

from the mailbox module docs:
"By defaul this is an rfc822.Message object (see the rfc822 module)."

The rfc822.Message object is only the headers. You need to read in the
message body separately.

When an instance of an rfc822.Message has just been read in, the file
pointer will be at the beginning of the message body. Read that in, I
guess.

Alternately, I have some code I've been working on (in very rough form)
that subclasses rfc822.Message and will read in separate messages in
mbox format (I've used it for such myself, for some utilities I've
worked with). If you are interested in that, give me a shout and I'll
send you what I have.

Also, if you'd just like to see examples how to read in message bodies
when working with rfc822.Message, I can give examples of those, also.

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/