-
Notifications
You must be signed in to change notification settings - Fork 682
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
fix cc mailaddress display name Garbled on multibyte character #1329
base: master
Are you sure you want to change the base?
Conversation
fix cc mailaddress display name Garbled on multibyte character
…_garbled-patch Update Mailer.java
Hello. We use this play1 for our production, and want this PR to be merged. https://lighthouseapp.com/dashboard seems to be unavailable, We really appreciate if you notice and make any response. Thank you. |
Hi @to-lz1 Play developers definitely still see what's happening here, and this is the right place to discuss about it ! Meanwhile, you could also use a custom build of Play which would include this PR and use it. Tell us if you need some tips to do so. |
That's right, we do see pull requests and comments. In this pull request, I would like to see a unit-test showing that the change does work. I expect to see the email sample that did need such a change. Then @xael-fry could make a release. |
Thank you very much for your quick response! I was relieved to hear that Play developers still check here, and I agree with @asolntsev. I think it would be better to add some unit-test and email samples to this PR. I'll talk to @ken-takagi about that (in fact, he is my colleague). |
@asolntsev Hi, I took a look at this issue. Without this change, mail address handling will be slightly different from what we expect.
As we can see, in the second example, non-ASCII characters are encoded based on RFC2047. Without this, our mailer can't know how to decode recipients' addresses, especially when they include some multibyte characters. We sometimes get garbled addresses such as I considered adding tests about this. But I think this problem is rather related to the behavior of Apache Commons' Email class. Moreover, in this(12 years old) commit, other (From, ReplyTo, and Bcc) addresses already experienced this change. Probably this change list has no bad effect, doesn't it? |
@to-lz1 Yes, I understand that this test seems more like a test for Apache Commons' Email class. But not only. It verifies that Play does use the right library. |
…_garbled-patch add test
…_garbled-patch fix unit test
@asolntsev |
@xael-fry How about including this PR in release 1.8.0? |
|
||
static void setAddresses(Email email) throws EmailException { | ||
email.setCharset("utf-8"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why forced the charset to utf-8 here ? in the upper code you only set the charset if define ?
Do you mean that a default value is need ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xael-fry
This encoding fix was originally written, in line 543.
This line appears to have been moved to the setAddresses () method as it relates to setting addresses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to keep the behavior of the original code.
In the original code, the encoding is changed to UTF-8 before setting the from, reply-to, to, cc, and bcc addresses, and is changed to charset
before setting the subject.
(I'm a co-worker of @ken-takagi and @yuba )
Purpose
fix cc mailaddress display name Garbled on multibyte character
Background Context
same bcc list approach?
References