<div dir="ltr">If you change the PR to use MimeMessage#setSubject(subject, charset) we should just add it. It's better to have it just work rather than require changing default system encoding or using -Dfile.encoding.</div><div class="gmail_extra"><br><div class="gmail_quote">On 7 June 2016 at 08:18, Nekrasov Aleksandr <span dir="ltr"><<a href="mailto:a.nekrasov@ftc.ru" target="_blank">a.nekrasov@ftc.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="RU" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I`m configured new allocated standalone keycloak server with your note and it was very helpful in all my cases.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Should we add a note to the documentation about this issue?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I`m already create issue <a href="https://issues.jboss.org/browse/KEYCLOAK-3089" target="_blank">https://issues.jboss.org/browse/KEYCLOAK-3089</a>
and PR <a href="https://github.com/keycloak/keycloak/pull/2918" target="_blank">https://github.com/keycloak/keycloak/pull/2918</a> for it. Do you need to reject it?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> Tair Sabirgaliev [mailto:<a href="mailto:tair.sabirgaliev@gmail.com" target="_blank">tair.sabirgaliev@gmail.com</a>]
<br>
<b>Sent:</b> Tuesday, June 07, 2016 11:52 AM<span class=""><br>
<b>To:</b> <a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a>; Некрасов Александр Сергеевич; Stian Thorgersen<br>
</span><b>Subject:</b> RE: [keycloak-user] Email internationalization<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">Did you try specifying default encoding for Java? <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">in bin/standalone.conf: JAVA_OPTS=“….. -Dfile.encoding=UTF-8"<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><u></u> <u></u></span></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">-- <br>
Tair Sabirgaliev<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><u></u> <u></u></span></p>
<p><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">On 7 June 2016 at 11:48:03, Nekrasov Aleksandr (<a href="mailto:a.nekrasov@ftc.ru" target="_blank">a.nekrasov@ftc.ru</a>) wrote:<u></u><u></u></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hello.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I have installed Wildfly10 on SunOS 5.10.
</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I am using Microsoft Outlook as a client and it shows header Subject as</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Subject: =?ISO646-US?B?Pz8/Pz8/Pz8/Pz8/PyA/Pz8/Pz8gPz8/Pz8/Pz8/Pz8gPz8/Pz8=?=</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">System encoding for some reasons is ISO646-US, which is diffefent with encoding, what
I needed.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> Tair Sabirgaliev [mailto:<a href="mailto:tair.sabirgaliev@gmail.com" target="_blank">tair.sabirgaliev@gmail.com</a>]
<br>
<b>Sent:</b> Tuesday, June 07, 2016 11:25 AM<br>
<b>To:</b> <a href="mailto:keycloak-user@lists.jboss.org" target="_blank">keycloak-user@lists.jboss.org</a>; Некрасов Александр Сергеевич; Stian Thorgersen<br>
<b>Subject:</b> Re: [keycloak-user] Email internationalization</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">Hi Aleksandr!</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">What is your Wildfly version?</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">Wildfly 8 has buggy Java Mail API. In Wildfly 9 and later proper encoding is done automatically, no need to `encodeText`
manually.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">See my answer here: </span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="http://stackoverflow.com/questions/35010796/wildfly-9-x-fails-encoding-greek-attachment-filenames" target="_blank"><span lang="EN-US">http://stackoverflow.com/questions/35010796/wildfly-9-x-fails-encoding-greek-attachment-filenames</span></a></span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif""> </span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">-- <br>
Tair Sabirgaliev</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">On 7 June 2016 at 11:03:50,
</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:keycloak-user-request@lists.jboss.org" target="_blank"><span lang="EN-US">keycloak-user-request@lists.jboss.org</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">
(</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:keycloak-user-request@lists.jboss.org" target="_blank"><span lang="EN-US">keycloak-user-request@lists.jboss.org</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">)
wrote:</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><u></u><u></u></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">Message: 1
<br>
Date: Mon, 6 Jun 2016 12:12:26 +0000 <br>
From: Nekrasov Aleksandr <</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:a.nekrasov@ftc.ru" target="_blank"><span lang="EN-US">a.nekrasov@ftc.ru</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">>
<br>
Subject: [keycloak-user] Email internationalization <br>
To: "</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:keycloak-user@lists.jboss.org" target="_blank"><span lang="EN-US">keycloak-user@lists.jboss.org</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">"
<</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:keycloak-user@lists.jboss.org" target="_blank"><span lang="EN-US">keycloak-user@lists.jboss.org</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">>
<br>
Message-ID: <</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:59219ba4c1b449d0a2bded5436b8ca6a@nut-mbx-4.win.ftc.ru" target="_blank"><span lang="EN-US">59219ba4c1b449d0a2bded5436b8ca6a@nut-mbx-4.win.ftc.ru</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">>
<br>
Content-Type: text/plain; charset="koi8-r" <br>
<br>
Hello everyone. <br>
</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">I found a bug when trying to send email from keycloak to users with encoding against English.
<br>
For example, when I try to send Russian message with subject "???????? ???? ??????? ??????" I see "????????????? ?????? ??????????? ?????" in my email.
<br>
<br>
I think you should update org.keycloak.email.DefaultEmailSenderProvider class with line
<br>
msg.setSubject(subject); <br>
to <br>
msg.setSubject(MimeUtility.encodeText(subject, "utf-8", "B")); <br>
<br>
Thanks. <br>
<br>
Nekrasov Aleksander, <br>
Developer, <br>
Center of Financial Techologies <br>
-------------- next part -------------- <br>
An HTML attachment was scrubbed... <br>
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">URL:
</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="http://lists.jboss.org/pipermail/keycloak-user/attachments/20160606/bea2f782/attachment-0001.html" target="_blank"><span lang="EN-US">http://lists.jboss.org/pipermail/keycloak-user/attachments/20160606/bea2f782/attachment-0001.html</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">
<br>
<br>
------------------------------ <br>
<br>
Message: 2 <br>
Date: Mon, 6 Jun 2016 19:38:59 +0200 <br>
From: Stian Thorgersen <</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:sthorger@redhat.com" target="_blank"><span lang="EN-US">sthorger@redhat.com</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">>
<br>
Subject: Re: [keycloak-user] Email internationalization <br>
To: Nekrasov Aleksandr <</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:a.nekrasov@ftc.ru" target="_blank"><span lang="EN-US">a.nekrasov@ftc.ru</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">>
<br>
Cc: "</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:keycloak-user@lists.jboss.org" target="_blank"><span lang="EN-US">keycloak-user@lists.jboss.org</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">"
<</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:keycloak-user@lists.jboss.org" target="_blank"><span lang="EN-US">keycloak-user@lists.jboss.org</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">>
<br>
Message-ID: <br>
<</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:CAJgngAeDFzb96dtFGgz59_RE-A3oGAJUNsNFPA-xXjxvYWipGw@mail.gmail.com" target="_blank"><span lang="EN-US">CAJgngAeDFzb96dtFGgz59_RE-A3oGAJUNsNFPA-xXjxvYWipGw@mail.gmail.com</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">>
<br>
Content-Type: text/plain; charset="utf-8" <br>
<br>
Please create a JIRA. </span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">If you want to submit a PR that would be welcome as
<br>
well. <br>
<br>
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">On 6 June 2016 at 14:12, Nekrasov Aleksandr <</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:a.nekrasov@ftc.ru" target="_blank"><span lang="EN-US">a.nekrasov@ftc.ru</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">>
wrote: <br>
<br>
> Hello everyone. <br>
</span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">> <br>
> I found a bug when trying to send email from keycloak to users with <br>
> encoding against English. <br>
> <br>
> For example, when I try to send Russian message with subject ????????? <br>
> ???? ??????? ??????? I see ?????????????? ?????? ??????????? ?????? in my <br>
> email. <br>
> <br>
> <br>
> <br>
> I think you should update org.keycloak.email.DefaultEmailSenderProvider <br>
> class with line <br>
> <br>
> msg.setSubject(subject); <br>
> <br>
> to <br>
> <br>
> msg.setSubject(MimeUtility.*encodeText*(subject, *"utf-8"*, *"B"*)); <br>
> <br>
> <br>
> <br>
> Thanks. <br>
</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">>
<br>
> <br>
> <br>
> Nekrasov Aleksander, <br>
> <br>
> Developer, <br>
> <br>
> Center of Financial Techologies <br>
> <br>
> _______________________________________________ <br>
> keycloak-user mailing list <br>
> </span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="mailto:keycloak-user@lists.jboss.org" target="_blank"><span lang="EN-US">keycloak-user@lists.jboss.org</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">
<br>
> </span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" target="_blank"><span lang="EN-US">https://lists.jboss.org/mailman/listinfo/keycloak-user</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">
<br>
> <br>
-------------- next part -------------- <br>
An HTML attachment was scrubbed... <br>
URL: </span><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif""><a href="http://lists.jboss.org/pipermail/keycloak-user/attachments/20160606/21c2041b/attachment-0001.html" target="_blank"><span lang="EN-US">http://lists.jboss.org/pipermail/keycloak-user/attachments/20160606/21c2041b/attachment-0001.html</span></a></span><span lang="EN-US" style="font-size:10.0pt;font-family:"Helvetica","sans-serif"">
<br>
<br>
------------------------------ </span><u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div></div></div>
</div>
</blockquote></div><br></div>