Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All e-mail content is interpreted as UTF-8, leading to a UnicodeDecodeError for some e-mails in a different encoding. #94

Open
geraldschmittinger opened this issue Jan 8, 2025 · 1 comment

Comments

@geraldschmittinger
Copy link

geraldschmittinger commented Jan 8, 2025

I encountered an issue with Open Trashmail:

When I send an e-mail in ISO-8859-1 encoding containing an ä, this causes the e-mail to be rejected due to a UniformDecodeError.

I figured that the reason for this is that in python/mailserver3.py (line 52), the content of the e-mail is always parsed as UTF-8. However, in ISO-8859-1, an ä has the code 0xE4, which is a continuation byte in UTF-8. When the character preceding this byte cannot validly be continued, the text is not valid unicode and therefore causes this error.

@geraldschmittinger geraldschmittinger changed the title All e-mail content is interpreted as UTF-8, leading to a UnicodeDecodeError for some e-mails in another encoding. All e-mail content is interpreted as UTF-8, leading to a UnicodeDecodeError for some e-mails in a different encoding. Jan 8, 2025
@RyanZufaellig
Copy link

Hello,
There is already a commit waiting to be accepted: 9aeae95
I made the changes myself, and it worked flawlessly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants