[spambayes-dev] If msg.as_string() fails...

Barry Warsaw barry at python.org
Mon May 3 09:21:57 EDT 2004


On Sun, 2004-05-02 at 15:56, Skip Montanaro wrote:

> I'd like to do something similar to what the POP3 proxy and IMAP filters do
> to graft in an X-Spambayes-Exception header, but at the point where this
> occurs all I have is an email.Message object, no raw message text as POP3
> and IMAP programs have.  Is there some way to unfailingly get the raw
> message text from an email.Message object?  I didn't see an obvious way to
> do this without doing precisely what email.Generator does.  Any clues?

No, but I've been thinking in email 3.0 to provide some kind of 'raw'
flag that would capture the original source of the message on an
attribute of the (outer) message object.

Note also that the intent is for the 3.0 parser to add a flag to the
message object if it encounters breakage.  That could be tokenized on
and to the extent that the breakage was unfixable, would be a flag to
the generator that as_string() and friends would fail.

-Barry





More information about the spambayes-dev mailing list