[Spambayes] Problems with unheader.py
Barry A. Warsaw
barry@python.org
Tue, 24 Sep 2002 23:58:07 -0400
>>>>> "TP" == Tim Peters <tim.one@comcast.net> writes:
TP> [Greg Ward]
>> ... OK: anyone know how to get the raw message body from an
>> email.Message object? Or am I gonna have to RTFM?
TP> Barry knows, but he usually won't tell you anything unless you
TP> buy him lunch first.
TP> str(msg) returns the whole msg as a string, including the
TP> headers. I'm not aware of a way to get just the body (unless
TP> you luck out and it's not multipart, in which case
TP> get_payload() does the trick).
There's always a way, and (ssh! don't tell Guido!) sometimes more than
one way.
Looks like you got what you wanted with HeaderParser, so we'll leave
it at that <wink>.
-Barry