Is this a mimetools/rfc822 bug?
sheila at spamcop.net
Mon Jun 25 21:53:43 EDT 2001
On Mon, 25 Jun 2001 16:53:32 -0400, barry at digicool.com (Barry A. Warsaw)
wrote in comp.lang.python in article
<mailman.993502542.22097.python-list at python.org>:
:>>>>> "SK" == Sheila King <sheila at thinkspot.net> writes:
: SK> But, according to the RFC's a header is required. A message
: SK> body is not required.
: SK> According to RFCs I recall: Your message header must have at
: SK> least one of the following headers: To, Bcc, or CC. I believe
: SK> that is the minimal header: any one of the To-type fields. No
: SK> other headers are required, and no message body is required.
:True, but the rfc822 module doesn't enforce any of these requirements,
:AFAIK. So it's really much more of an issue of the rfc822.py module's
:API than it is of the actual RFC.
Sorry, I didn't make my point well. You stated that:
Barry > It's even worse if you have no headers,
Barry > but your first body line has a colon in it!
My point, was that rfc822 requires a header, however minimal. (I know it
technically requires one of the following: To, CC, Bcc..whatever, the
point is a header is required.)
The rfc822.py module really doesn't try to enforce RFC822 at all. It
assumes that the programmer will be sufficiently knowledgeable in the
RFCs to use the module correctly.
I can't imagine why anyone would want to use rfc822.py if they only had
a message body and no header. rfc822.py is really written for handling
I guess it is incumbent upon the programmer using the module to check
his data first, and make sure it conforms to the assumptions that
rfc822.py makes: namely, that it will be starting to read at a header,
that there will be to newline characters in a row to mark the end of the
headers, and that after that it will be pointing to the message body (if
there is one).
More information about the Python-list