:mod:`rfc822` --- Parse RFC 2822 mail headers
This module defines a class, :class:`Message`, which represents an "email message" as defined by the Internet standard RFC 2822.  Such messages consist of a collection of message headers, and a message body. This module also defines a helper class :class:`AddressList` for parsing RFC 2822 addresses. Please refer to the RFC for information on the specific syntax of RFC 2822 messages.
The :mod:`mailbox` module provides classes to read mailboxes produced by various end-user mail programs.
A :class:`Message` instance has the following methods:
:class:`Message` instances also support a limited mapping interface. In particular: m[name] is like m.getheader(name) but raises :exc:`KeyError` if there is no matching header; and len(m), m.get(name[, default]), name in m, m.keys(), m.values() m.items(), and m.setdefault(name[, default]) act as expected, with the one difference that :meth:`setdefault` uses an empty string as the default value. :class:`Message` instances also support the mapping writable interface m[name] = value and del m[name]. :class:`Message` objects do not support the :meth:`clear`, :meth:`copy`, :meth:`popitem`, or :meth:`update` methods of the mapping interface. (Support for :meth:`get` and :meth:`setdefault` was only added in Python 2.2.)
Finally, :class:`Message` instances have some public instance variables:
An :class:`AddressList` instance has the following methods:
Finally, :class:`AddressList` instances have one public instance variable:
|||This module originally conformed to RFC 822, hence the name. Since then, RFC 2822 has been released as an update to RFC 822. This module should be considered RFC 2822-conformant, especially in cases where the syntax or semantics have changed since RFC 822.|