@@ -403,11 +403,26 @@ added matters. To illustrate::
403403 .. attribute :: utf8
404404
405405 If ``False ``, follow :rfc: `5322 `, supporting non-ASCII characters in
406- headers by encoding them as "encoded words". If ``True ``, follow
407- :rfc: `6532 ` and use ``utf-8 `` encoding for headers. Messages
406+ headers by encoding them as :rfc: ` 2047 ` "encoded words". If ``True ``,
407+ follow :rfc: `6532 ` and use ``utf-8 `` encoding for headers. Messages
408408 formatted in this way may be passed to SMTP servers that support
409409 the ``SMTPUTF8 `` extension (:rfc: `6531 `).
410410
411+ When ``False ``, the generator will raise
412+ :exc: `~email.errors.HeaderWriteError ` if any header includes non-ASCII
413+ characters in a context where :rfc: `2047 ` does not permit encoded words.
414+ This particularly applies to mailboxes ("addr-spec") with non-ASCII
415+ characters, which can be created via
416+ :class: `~email.headerregistry.Address `. To use a mailbox with a non-ASCII
417+ domain name with ``utf8=False ``, first encode the domain using the
418+ third-party :pypi: `idna ` or :pypi: `uts46 ` module or with
419+ :mod: `encodings.idna `. It is not possible to use a non-ASCII username
420+ ("local-part") in a mailbox when ``utf8=False ``.
421+
422+ .. versionchanged :: 3.15
423+ Can trigger the raising of :exc: `~email.errors.HeaderWriteError `.
424+ (Earlier versions incorrectly applied :rfc: `2047 ` in certain contexts,
425+ mostly notably in addr-specs.)
411426
412427 .. attribute :: refold_source
413428
0 commit comments