Email and MIME Modules
email.policy
Controls header handling, line endings, serialization and defect processing across the email package. Policies can be cloned with adjusted options rather than mutated. SMTP uses CRLF line separators, while the default policy uses LF for local processing.
Formal Syntax & Structure
python syntaxpython
import email.policyReturn Value
module
Module namespace available through import; import is a statement, not a value-returning expression.
Working Example
Example Snippetpython
from email import policyprint(repr(policy.default.linesep), repr(policy.SMTP.linesep))