Currently whenever an MboxMessage is created, we decode the 8-bit input stream as UTF-8. For example:
class MessagePlainTextParser(BaseParser):
media_type = 'message/rfc822'
def parse(self, stream, media_type=None, parser_context=None):
data = stream.read().decode("utf-8")
return MboxMessage(data).get_json()
However, the encoding is specified in the email headers, which are always 7-bit. So MboxMessage should take a bytes object, not a string. The same issue is present in both the legacy and the REST APIs
Currently whenever an MboxMessage is created, we decode the 8-bit input stream as UTF-8. For example:
However, the encoding is specified in the email headers, which are always 7-bit. So MboxMessage should take a bytes object, not a string. The same issue is present in both the legacy and the REST APIs