email.headerregistry.BaseHeader.name

name The name of the header (the portion of the field before the ‘:’). This is exactly the value passed in the header_factory call for name; that is, case is preserved.

email.headerregistry.BaseHeader.max_count

max_count The maximum number of headers of this type that can have the same name. A value of None means unlimited. The BaseHeader value for this attribute is None; it is expected that specialized header classes will override this value as needed.

email.headerregistry.BaseHeader.fold()

fold(*, policy) Return a string containing linesep characters as required to correctly fold the header according to policy. A cte_type of 8bit will be treated as if it were 7bit, since strings may not contain binary data.

email.headerregistry.BaseHeader.defects

defects A tuple of HeaderDefect instances reporting any RFC compliance problems found during parsing. The email package tries to be complete about detecting compliance issues. See the errors module for a discussion of the types of defects that may be reported.

email.headerregistry.BaseHeader

class email.headerregistry.BaseHeader(name, value) name and value are passed to BaseHeader from the header_factory call. The string value of any header object is the value fully decoded to unicode. This base class defines the following read-only properties: name The name of the header (the portion of the field before the ‘:’). This is exactly the value passed in the header_factory call for name; that is, case is preserved. defects A tuple of HeaderDefect instances reporting any RFC

email.headerregistry.AddressHeader.groups

groups A tuple of Group objects encoding the addresses and groups found in the header value. Addresses that are not part of a group are represented in this list as single-address Groups whose display_name is None.

email.headerregistry.AddressHeader.addresses

addresses A tuple of Address objects encoding all of the individual addresses from the header value. If the header value contains any groups, the individual addresses from the group are included in the list at the point where the group occurs in the value (that is, the list of addresses is “flattened” into a one dimensional list).

email.headerregistry.AddressHeader

class email.headerregistry.AddressHeader Address headers are one of the most complex structured header types. The AddressHeader class provides a generic interface to any address header. This header type provides the following additional attributes: groups A tuple of Group objects encoding the addresses and groups found in the header value. Addresses that are not part of a group are represented in this list as single-address Groups whose display_name is None. addresses A tuple of Add

email.headerregistry.Address.__str__()

__str__() The str value of the object is the address quoted according to RFC 5322 rules, but with no Content Transfer Encoding of any non-ASCII characters.

email.headerregistry.Address.username

username The username portion of the address, with all quoting removed.