Github user sebbASF commented on the issue:

    https://github.com/apache/incubator-ponymail/issues/265
  
    Note that the Source version [2] of the message is also mangled in 
lists.a.o; it includes other odd characters (not the replacement char).
    
    I tried parsing the input using 
    msg = email.message_from_bytes(sys.stdin.buffer.read())
    instead of
    input_stream = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8', 
errors="ignore")
    msgstring = input_stream.read()
    msg = email.message_from_string(msgstring)
    
    That fixes the display problem, however the source message then uses Base64 
encoding for the body, which is not ideal as it cannot be read directly. It 
looks like the source problem is caused by using message.as_string() to 
re-create the source from the parsed mail. That may be to do with the original 
having been 8-bit.
    
    [2] 
https://lists.apache.org/api/source.lua/52ecda6f7b859fa9cdd4d9fb64d6f7a3b54f29f971e5536e844d9150@%3Cdev.johnzon.apache.org%3E


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to