[Email-SIG] API for Header objects [was: Dropping bytes "support" in json]

Stephen J. Turnbull stephen at xemacs.org
Fri Apr 17 12:20:30 CEST 2009


R. David Murray writes:

 > Note that while I want to be able to do str(someHeader) to get a
 > string representation of a header body, I'm not so enamored of being
 > able to do
 > 
 >      message['From'] = 'John Smith <john at foo.com>'
 > 
 > and have it get turned into a Header or AddressHeader object.
 > Frankly, that looks too magical to me.

+1

Well, that would make it easy to write scripts that parse lists of
addresses and do things with them.  Eg, a mailing list manager's "mass
subscribe" interface.  That would be nice ... but on reflection it's
clear that we would want that to be parsed *strictly*.  So it raises
exceptions, which must be caught and handled, etc etc.  In other
words, it's actually not so easy to write scripts, no matter what you
do, and you also want to be able to specify what kind of magical
fixups (the ever-popular "display-name with unquoted period"
immediately comes to mind as one example) are acceptable, and which
are not, not to mention encoding for non-ASCII text.

How about unstructured header bodies, like "Subject"?  Should we allow
it, for convenience, or not, for consistency?

How about unknown fields, eg "X-Are-We-Not-Structured-No-We-Are-Devo"?

I think, in the first draft, we should be *consistent* in both cases.



More information about the Email-SIG mailing list