diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/email.policy.rst | 8 | ||||
-rw-r--r-- | Doc/whatsnew/3.5.rst | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Doc/library/email.policy.rst b/Doc/library/email.policy.rst index d4e3fc1..9fadfb3 100644 --- a/Doc/library/email.policy.rst +++ b/Doc/library/email.policy.rst @@ -378,6 +378,14 @@ added matters. To illustrate:: In addition to the settable attributes listed above that apply to all policies, this policy adds the following additional attributes: + .. attribute:: utf8 + + If ``False``, follow :rfc:`5322`, supporting non-ASCII characters in + headers by encoding them as "encoded words". If ``True``, follow + :rfc:`6532` and use ``utf-8`` encoding for headers. Messages + formatted in this way may be passed to SMTP servers that support + the ``SMTPUTF8`` extension (:rfc:`6531`). + .. attribute:: refold_source If the value for a header in the ``Message`` object originated from a diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index 0360de4..51a3aa3 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -356,6 +356,12 @@ email header (``None`` if there is no such header). (Contributed by Abhilash Raj in :issue:`21083`.) +* A new policy option :attr:`~email.policy.EmailPolicy.utf8` can be set + ``True`` to encode email headers using the utf8 charset instead of using + encoded words. This allows ``Messages`` to be formatted according to + :rfc:`6532` and used with an SMTP server that supports the :rfc:`6531` + ``SMTPUTF8`` extension. (Contributed by R. David Murray in :issue:`24211`.) + glob ---- |