email.policy.Compat32.mangle_from_

mangle_from_ The default is True.

email.policy.EmailPolicy.content_manager

content_manager An object with at least two methods: get_content and set_content. When the get_content() or set_content() method of a Message object is called, it calls the corresponding method of this object, passing it the message object as its first argument, and any arguments or keywords that were passed to it as additional arguments. By default content_manager is set to raw_data_manager. New in version 3.4.

email.policy.Compat32.header_store_parse()

header_store_parse(name, value) The name and value are returned unmodified.

email.policy.Compat32.header_fetch_parse()

header_fetch_parse(name, value) If the value contains binary data, it is converted into a Header object using the unknown-8bit charset. Otherwise it is returned unmodified.

email.policy.Compat32.fold_binary()

fold_binary(name, value) Headers are folded using the Header folding algorithm, which preserves existing line breaks in the value, and wraps each resulting line to the max_line_length. If cte_type is 7bit, non-ascii binary data is CTE encoded using the unknown-8bit charset. Otherwise the original source header is used, with its existing line breaks and any (RFC invalid) binary data it may contain.

email.policy.Compat32.header_source_parse()

header_source_parse(sourcelines) The name is parsed as everything up to the ‘:‘ and returned unmodified. The value is determined by stripping leading whitespace off the remainder of the first line, joining all subsequent lines together, and stripping any trailing carriage return or linefeed characters.

email.policy.Compat32

class email.policy.Compat32(**kw) This concrete Policy is the backward compatibility policy. It replicates the behavior of the email package in Python 3.2. The policy module also defines an instance of this class, compat32, that is used as the default policy. Thus the default behavior of the email package is to maintain compatibility with Python 3.2. The following attributes have values that are different from the Policy default: mangle_from_ The default is True. The class provides the

email.policy.Compat32.fold()

fold(name, value) Headers are folded using the Header folding algorithm, which preserves existing line breaks in the value, and wraps each resulting line to the max_line_length. Non-ASCII binary data are CTE encoded using the unknown-8bit charset.

email.parser.Parser.parse()

parse(fp, headersonly=False) Read all the data from the file-like object fp, parse the resulting text, and return the root message object. fp must support both the readline() and the read() methods on file-like objects. The text contained in fp must be formatted as a block of RFC 2822 style headers and header continuation lines, optionally preceded by an envelope header. The header block is terminated either by the end of the data or by a blank line. Following the header block is the body of

email.parser.FeedParser.close()

close() Closing a FeedParser completes the parsing of all previously fed data, and returns the root message object. It is undefined what happens if you feed more data to a closed FeedParser.