Skip to content
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

text/calendar as string -> ClassCastException #311

Closed
hayblondin opened this issue Apr 13, 2021 · 1 comment
Closed

text/calendar as string -> ClassCastException #311

hayblondin opened this issue Apr 13, 2021 · 1 comment

Comments

@hayblondin
Copy link

Hello,

i have got a mail with a part having a "text/calendar" mimetype converted as a string content :

--000000000000b7af0405bf5ce7e3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/calendar; charset="UTF-8"; method=REQUEST

BEGIN:VCALENDAR
PRODID:-//Events Calendar//iCal4j 1.0//EN
VERSION:2.0
CALSCALE:GREGORIAN
etc...

Which throws this exception (tested with the 6.5.1 version) :

java.lang.ClassCastException: class java.lang.String cannot be cast to class java.io.InputStream (java.lang.String and java.io.InputStream are in module java.base of loader 'bootstrap')
	at org.simplejavamail.converter.internal.mimemessage.MimeMessageParser.parseMimePartTree(MimeMessageParser.java:159)

it seems that the RFC 2445 allow this format.

bbottema added a commit that referenced this issue Apr 15, 2021
fix: resolves #311 - text/calendar as string -> ClassCastException, by taking the value as String if it is not an InputStream
@bbottema bbottema added this to the 6.5.2 milestone Apr 15, 2021
@bbottema
Copy link
Owner

Fix released in 6.5.2. Thank you for your effort!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants