[issue12649] email.Header ignores maxlinelen when wrapping encoded words

R. David Murray report at bugs.python.org
Thu Jul 28 17:53:20 CEST 2011


R. David Murray <rdmurray at bitdance.com> added the comment:

Interesting thread.  I have my eye on supporting 5335 in the revised email package, but it is secondary goal to getting an improved API for the already-accepted RFCs.

You will note that the encoded word local part is *not* standard.  I think the email package may decode them anyway, but just like TB it provides no mechanism for creating them in the first place since it is not RFC compliant.  You could open a feature request for adding support for doing so (as an *optional* feature :), which I would then try to get in to 3.3.  (It puzzles me why it *isn't* allowed by the RFC, by the way).

To do it yourself now, you will probably have to create a temporary Header, pass it just the local part, call its encode or __str__ to get the encoded word (which won't have any spaces since it will be the only token), and then format that in to your rebuilt address string.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12649>
_______________________________________


More information about the Python-bugs-list mailing list