Bug in rfc822

Barry A. Warsaw barry at digicool.com
Mon Jul 9 21:12:17 EDT 2001


>>>>> "ph" == phil hunt <philh at comuno.freeserve.co.uk> writes:

    ph> I am currently writing a program that reads emails, modifies
    ph> them in various ways (adding headers, encryption, etc) and
    ph> outputs the result.

This actually sound like a good fit for mimelib, which is arguably
misnamed (perhaps it should be called maillib?).

    ph> As part of this program, I'm writing a mail module that (when
    ph> finished) could be hacked into a replacement for rfc822.
    ph> rfc822's functionality is to read mail headers and allow
    ph> interrogation of their values easily. My module is
    ph> conceptually on a higher level; containing a MailHeader class
    ph> which can be used to write as well as read ascii
    ph> representations of email, and a Mail class that includes the
    ph> header and the body; again for composition as well as reading
    ph> emails. (for now, it uses rfc822 to parse incoming headsers).

mimelib uses rfc822 for some functionality, but it has its own Parser
and Generator class (to go from plaintext -> object tree ->
plaintext).  It uses rfc822 for some parts of the implementation, such
as parsing addresses and realnames out of strings (so it's vulnerable
to the RFC 2822 updates as well).

    ph> When it is written, perhaps it could be considered for
    ph> eventual inclusion in the standard library (I say eventually,
    ph> because IMO it'll take me a few attempts to get the API
    ph> exactly right)

That's the hard part, all right!

    ph> My module doesn't know anything about Mime; which is good
    ph> because IMO there is room for a library that is higher-level
    ph> than rfc822 but lower levelb than knowing about Mime.

    ph> What is the process of getting a module in the standard
    ph> library?

Post the code. :)  I definitely want to look at what you've got, to
see how well (or if) it fits with mimelib.  IMO, if we're going aim at
replacing rfc822.py and all the various and sundry MIME attempts, we
ought to do it right, and simplify the choices end-users have to make
in order to manipulate email messages.

Let's collaborate!
-Barry




More information about the Python-list mailing list