RELEASED email package version 1.2

Barry A. Warsaw
Mon, 18 Mar 2002 12:26:49 -0500

I've released the standalone email package version 1.2.  This version
has much better support RFC 2047, especially when using multibyte
character sets (much thanks go to Ben Gertzfield).  A NEWS file
excerpt is included below.

I will eventually be merging this code into the Python distro, but
there are a few new features I want to look at first.  One of them
includes RFC 2231 support (written by Oleg Broytmann).

You can get the standalone email package from SourceForge:

Bug reports to this project please, not to the Python bug tracker
(until this code is merged into the Python distro).


-------------------- snip snip --------------------
1.2 (18-Mar-2002)

    - In the MIMEText class's constructor, the _encoder argument is
      deprecated.  You will get a DeprecationWarning if you try to use
      it.  This is because there is a fundamental conflict between
      _encoder and the fact that _charset is passed to the underlying
      set_payload() method.  _encoder really makes no sense any more.

    - When Message.set_type() is used to set the Content-Type: header,
      the MIME-Version: header is always set (overriding any existing
      MIME-Version: header).

    - More liberal acceptance of parameter formatting, e.g. this is
      now accepted: Content-Type: multipart/mixed; boundary = "FOO"
      I.e. spaces around the = sign.

    - Bug fix in Generator related to splitting long lines in a
      multiline header.

    - In class Charset, __str__() method added, as were __eq__() and

    - Charset.get_body_encoding() may now return a function as well as
      a string character set name.  The function takes a single
      argument, which is a Message instance, and may change the
      Content-Transfer-Encoding: header (or do any other manipulations
      on the message).

    - Charset.from_splittable() added argument to_output which is used
      to specify whether the input_codec or the output_codec is used
      for the conversion (by default, the output codec is used).

1.1 (unreleased)

    - No changes since 0.97.  Only the version number has changed.

0.97 (unreleased)

    - Message.set_charset() can now take a string naming a character
      set in addition to a Charset instance.  In the former case, a
      Charset is instantiated by passing the string to its

    - The MIMEText constructor now passes the _charset argument to the
      underlying set_charset() method.  This makes things consistent
      at the cost of a minor semantic change: the resulting instance
      will have a Content-Transfer-Encoding: header where previously
      it did not.

    - A fix for a crash when quopriMIME.encode() tried to encode a
      multiline string containing a blank line.

    - New module which provides a higher level interface for
      encoded email headers, such as Subject:, From:, and To:.  This
      module provides an abstraction for composing such headers out of
      charset encoded parts, and for decoding such headers.  It
      properly splits lines on character boundaries even for multibyte
      character sets.

    - New RFC compliant base64 and quoted-printable modules, called and  These are intended to replace
      the Python standard and modules, but are
      geared toward their use conformant to the various MIME email

    - The Message class is much more character set aware and RFC
        + set_payload() now takes a new optional charset argument
        + New methods set_charset(), get_charset(), set_param(),
          del_param(), set_type()
        + Header parameter quoting is more RFC compliant
        + get_param() and get_params() now take a new optional unquote

    - The Charset module now knows about utf-8, gb2132, and big5
      codecs, the latter two of which are available independently of
      Python (see the comments in this module for downloading Chinese,
      Japanese, and Korean codecs).

      New Charset methods get_body_encoding(), get_output_charset(),
      encoded_header_len(), header_encode(), and body_encode().

    - The Generator now handles encoding the body, if the message
      object has a character set.

    - The Utils module has new functions fix_eols() and make_msgid().
      It also includes a workaround for bugs in parseaddr() when used
      with Python versions before 2.2.

    - A fix for a Parser bug when parsing multipart/* parts that
      contain only a single subpart.