[Email-SIG] fixing the current email module

Stephen J. Turnbull stephen at xemacs.org
Thu Oct 8 17:43:43 CEST 2009


Barry Warsaw writes:
 > On Oct 8, 2009, at 3:29 AM, Glenn Linderman wrote:

 > > Headers could possibly be a quadruple instead of a triple, with the  
 > > 4th item being the wire format if received?

I think the whole input format (note, not necessarily wire!) should be
saved off on the top-level Message object (possibly in a file, per
Barry's comments about that).  Subobjects could then refer to to
pieces of that as position ranges.

 > I think not a quad.  I think other APIs should be used to extract the  
 > raw data, e.g.
 > 
 >  >>> # return a unicode or throw an exception
 >  >>> text = str(header)
 >  >>> # should always be okay even if gibberish
 >  >>> raw = bytes(header)
 > 
 > or /something/ like that.

Does that work?  I would think (especially in parallel to text) you
want bytes(header) to be the wire format.  If so, you want it to raise
if it knows it contains gibberish.

And again, we have the problem of whether it should return with the
field name prepended or just the field body.

I have a feeling we should not try to decide what APIs we're going to
spell as __str__ and __bytes__ yet.


More information about the Email-SIG mailing list