This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gkuenning
Recipients gkuenning
Date 2017-12-13.01:17:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1513127837.95.0.213398074469.issue32298@psf.upfronthosting.co.za>
In-reply-to
Content
Email.quopriprime creates a map of header and body bytes that need no encoding:

for c in b'-!*+/' + ascii_letters.encode('ascii') + digits.encode('ascii'):
    _QUOPRI_HEADER_MAP[c] = chr(c)

This map is overly restrictive; in fact only two printable characters need to be omitted: the space and the equals sign.  The following revision to the loop creates a correct table:

for c in list(range(33, 61)) + list(range(62, 127)):
    _QUOPRI_HEADER_MAP[c] = chr(c)

Why does this matter?  Well, first, it's wasteful since it creates messages with larger headers than necessary.  But more important, it makes it impossible for other tools to operate on the messages unless they're encoding aware; for example, one can't easily grep for "foo@bar.com" because the at sign is encoded as =40.
History
Date User Action Args
2017-12-13 01:17:18gkuenningsetrecipients: + gkuenning
2017-12-13 01:17:17gkuenningsetmessageid: <1513127837.95.0.213398074469.issue32298@psf.upfronthosting.co.za>
2017-12-13 01:17:17gkuenninglinkissue32298 messages
2017-12-13 01:17:14gkuenningcreate