mail-api icon indicating copy to clipboard operation
mail-api copied to clipboard

java.io.IOException: Unknown encoding:

Open stormlong opened this issue 5 years ago • 1 comments

Exception in thread "main" java.io.IOException: Unknown encoding: at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:92) at com.sun.mail.handlers.text_plain.getContent(text_plain.java:59) at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:795) at javax.activation.DataHandler.getContent(DataHandler.java:542) at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:659) Caused by: javax.mail.MessagingException: Unknown encoding: at javax.mail.internet.MimeUtility.decode(MimeUtility.java:381) at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:85) ... 9 more

I find same problem from this https://github.com/javaee/javamail/pull/312 but ,it seems still not solve

stormlong avatar Jan 17 '20 08:01 stormlong

I still need an example of a message to has this problem. Please post the raw MIME content of such a message.

Most likely the message was incorrectly encoded. You can try to guess what it meant by using the getRawInputStream method and read the raw data and try to decode it yourself.

bshannon avatar Jan 30 '20 04:01 bshannon