mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #18] Japanese, Chinese, or Korean text not showing up properly #15
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rogerdz on GitHub (Oct 17, 2022).
Original GitHub issue: https://github.com/axllent/mailpit/issues/18
I have Maipit running on a Docker container, with the following command:
docker run -d \ --restart unless-stopped \ --name=mailpit \ -p 8025:8025 \ -p 1025:1025 \ axllent/mailpit@axllent commented on GitHub (Oct 17, 2022):
Thank you. Are you able to attach an example email to this issue so I can do further testing please?
@rogerdz commented on GitHub (Oct 18, 2022):
I attach example mail:
57646be0-8dbe-4ebf-89b4-fd5c32fda3d8.zip
I use command line for test send mail:
echo -e "To:receiver1@domain1, receiver2@domain2 \nSubject:Subject of email 熟語ルビの例 일욜에 만나~ 读写汉字 اثنا عشر شهرا في كتاب Tiếng việt \n\nBody of email. 熟語ルビの例 일욜에 만나~ 读写汉字 اثنا عشر شهرا في كتاب Tiếng việt\n" | /usr/sbin/sendmail -f sender@domain -F sendername -it@axllent commented on GitHub (Oct 18, 2022):
Thank you. I can confirm the issue, I'm just not sure what to do about it. I'll do a bit more testing, but it appears to be a limitation of https://github.com/jhillyerd/enmime (which Mailpit uses to parse emails), so I may have to ask there what, if anything, can be done. The email itself does not specify the encoding / character type anywhere, so I think it is guessing (wrong).
@rogerdz commented on GitHub (Oct 18, 2022):
I don't have much experience with go, but in nodejs email processing library (example: https://github.com/mazira/mailparser-mit) there is an option defaultCharset (set value is utf-8) to handle when email does not specify charset.
You can check https://github.com/jhillyerd/enmime to see if there is something similar ^^
@axllent commented on GitHub (Oct 19, 2022):
I believe we've gotten to the bottom of it. The problem here is that the email RFC clearly states that the default content type for all email is
"text/plain; charset=us-ascii", so anything outside of this should be set in the email headers. Whilst the email library Mailpit uses does try guess this (if not set), it is not reliable.In your case you should be defining the correct content type in your email headers to handle the characters, and not expecting the email client to guess correctly.
@axllent commented on GitHub (Oct 19, 2022):
I can confirm that setting the
Content-Type: text/plain; charset="UTF-8"header in the email headers fixes the issue entirely in the UI as the mail parser in Mailpit (or any email program) then knows what character set to use when decoding the email 👍