Wildfly 9.x cannot encode Greek attachment file names

I use javax.mail to call the mail server and send the file as an email attachment encoding the file name as follows: MimeUtility.encodeText(filename,"UTF-8",null)

While this works fine on WildFly 8 , it does not work on WildFly 9.x with the mail server . I mean, the description of the attachment was received in this format: =UTF-8BzrTOv866zrnOvM63IM68zrUgzrXOu867zrfOvc65zrrOsS5wZGY==

I've tried:

1) To find the relative setting on the application server - no luck.

2) Encode with ISO-8859-7 , which only works from time to time, since it seems to depend on the length of the file name and the presence of some characters.

3) Find the relative setting on the client (microsoft outlook), which, I believe, will skip some information for successful decoding.

Any ideas?

Thanks in advance!

+7
java encoding utf-8 wildfly wildfly-9
source share
1 answer

To test your problem, I created a demo project here . It sends messages with non-ascii characters in different parts, but does not use encodeText , since it is automatically processed by the Mail API. I tested it with Wildfly 8, 9, 10 to send http://mailtrap.io messages.

The first screen displays a message sent from Wildfly 8. The attachment is not sent properly, so it is missing:

Attachment sent incorrectly in Wildfly 8

The second screen is the messages sent by Wildfly 9 (the same for 10). As you can see, there is an attachment with the corresponding file name:

For Wildfly 9 and 10, everything is fine!

So what could be the problem here?

  • Wildfly 8 comes with Java Mail API 1.5.1
  • Wildfly 9 comes with Java Mail API 1.5.3
  • Wildfly 10 ships with Java Mail API 1.5.5

I think you are experiencing an error in Java Mail version 1.5.1.

Most likely, you worked on this error when encoding Wildfly 8 (manually using encodeText ), now the workaround is causing problems.

0
source share

All Articles