<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap:break-word"><div>Hi Aleksandr!</div><div><br></div><div>What is your Wildfly version?</div><div><br></div><div>Wildfly 8 has buggy Java Mail API. In Wildfly 9 and later proper encoding is done automatically, no need to `encodeText` manually.</div><div><br></div><div>See my answer here: <a href="http://stackoverflow.com/questions/35010796/wildfly-9-x-fails-encoding-greek-attachment-filenames">http://stackoverflow.com/questions/35010796/wildfly-9-x-fails-encoding-greek-attachment-filenames</a></div><div><br></div><div>-- </div><div>Tair Sabirgaliev</div><div><br></div><div><br></div><div>On 7 June 2016 at 11:03:50, <a href="mailto:keycloak-user-request@lists.jboss.org">keycloak-user-request@lists.jboss.org</a> (<a href="mailto:keycloak-user-request@lists.jboss.org">keycloak-user-request@lists.jboss.org</a>) wrote:</div><div><br></div><div>Message: 1</div><div>Date: Mon, 6 Jun 2016 12:12:26 +0000</div><div>From: Nekrasov Aleksandr <<a href="mailto:a.nekrasov@ftc.ru">a.nekrasov@ftc.ru</a>></div><div>Subject: [keycloak-user] Email internationalization</div><div>To: "<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>" <<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>></div><div>Message-ID: <<a href="mailto:59219ba4c1b449d0a2bded5436b8ca6a@nut-mbx-4.win.ftc.ru">59219ba4c1b449d0a2bded5436b8ca6a@nut-mbx-4.win.ftc.ru</a>></div><div>Content-Type: text/plain; charset="koi8-r"</div><div><br></div><div>Hello everyone.</div><div>I found a bug when trying to send email from keycloak to users with encoding against English.</div><div>For example, when I try to send Russian message with subject "???????? ???? ??????? ??????" I see "????????????? ?????? ??????????? ?????" in my email.</div><div><br></div><div>I think you should update org.keycloak.email.DefaultEmailSenderProvider class with line</div><div>msg.setSubject(subject);</div><div>to</div><div>msg.setSubject(MimeUtility.encodeText(subject, "utf-8", "B"));</div><div><br></div><div>Thanks.</div><div><br></div><div>Nekrasov Aleksander,</div><div>Developer,</div><div>Center of Financial Techologies</div><div>-------------- next part --------------</div><div>An HTML attachment was scrubbed...</div><div>URL: <a href="http://lists.jboss.org/pipermail/keycloak-user/attachments/20160606/bea2f782/attachment-0001.html">http://lists.jboss.org/pipermail/keycloak-user/attachments/20160606/bea2f782/attachment-0001.html</a></div><div><br></div><div>------------------------------</div><div><br></div><div>Message: 2</div><div>Date: Mon, 6 Jun 2016 19:38:59 +0200</div><div>From: Stian Thorgersen <<a href="mailto:sthorger@redhat.com">sthorger@redhat.com</a>></div><div>Subject: Re: [keycloak-user] Email internationalization</div><div>To: Nekrasov Aleksandr <<a href="mailto:a.nekrasov@ftc.ru">a.nekrasov@ftc.ru</a>></div><div>Cc: "<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>" <<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>></div><div>Message-ID:</div><div><<a href="mailto:CAJgngAeDFzb96dtFGgz59_RE-A3oGAJUNsNFPA-xXjxvYWipGw@mail.gmail.com">CAJgngAeDFzb96dtFGgz59_RE-A3oGAJUNsNFPA-xXjxvYWipGw@mail.gmail.com</a>></div><div>Content-Type: text/plain; charset="utf-8"</div><div><br></div><div>Please create a JIRA. If you want to submit a PR that would be welcome as</div><div>well.</div><div><br></div><div>On 6 June 2016 at 14:12, Nekrasov Aleksandr <<a href="mailto:a.nekrasov@ftc.ru">a.nekrasov@ftc.ru</a>> wrote:</div><div><br></div><div>> Hello everyone.</div><div>></div><div>> I found a bug when trying to send email from keycloak to users with</div><div>> encoding against English.</div><div>></div><div>> For example, when I try to send Russian message with subject ?????????</div><div>> ???? ??????? ??????? I see ?????????????? ?????? ??????????? ?????? in my</div><div>> email.</div><div>></div><div>></div><div>></div><div>> I think you should update org.keycloak.email.DefaultEmailSenderProvider</div><div>> class with line</div><div>></div><div>> msg.setSubject(subject);</div><div>></div><div>> to</div><div>></div><div>> msg.setSubject(MimeUtility.*encodeText*(subject, *"utf-8"*, *"B"*));</div><div>></div><div>></div><div>></div><div>> Thanks.</div><div>></div><div>></div><div>></div><div>> Nekrasov Aleksander,</div><div>></div><div>> Developer,</div><div>></div><div>> Center of Financial Techologies</div><div>></div><div>> _______________________________________________</div><div>> keycloak-user mailing list</div><div>> <a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a></div><div>> <a href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></div><div>></div><div>-------------- next part --------------</div><div>An HTML attachment was scrubbed...</div><div>URL: <a href="http://lists.jboss.org/pipermail/keycloak-user/attachments/20160606/21c2041b/attachment-0001.html">http://lists.jboss.org/pipermail/keycloak-user/attachments/20160606/21c2041b/attachment-0001.html</a></div><div><br></div><div>------------------------------</div></body></html>