bbottema / simple-java-mail

Simple API, Complex Emails (Jakarta Mail smtp wrapper)
http://www.simplejavamail.org
Apache License 2.0
1.22k stars 267 forks source link

[bug] support iCalendar events with METHOD defined in body instead of Content-Type #552

Closed IvanPriests closed 2 weeks ago

IvanPriests commented 2 weeks ago

Simple Java Mail currently relies solely on the iCalendar MimePart's Content-Type to determine the METHOD, but this isn't fully spec-compliant. While many email providers include METHOD in the Content-Type for convenience, it's only mandatory in the actual calendar body.

ORIGINAL REPORT:

I received an email that was missing the calendar method, but it was still a calendar email. For my email parser, the specific method is not as important; what matters is that the email was received and its other parameters. However, the parser broke while trying to parse this type of email. I request that you add the ability to disable parsing of calendar content for

example broken email: brokenMessageEml.txt

IvanPriests commented 2 weeks ago

I'm use org.simplejavamail.converter.internal.mimemessage.MimeMessageParser.parseMimeMessage(mimeMessage) for parse email content and headers

bbottema commented 2 weeks ago

Thank you for reporting. This is actually a bug and the METHOD should be parsed properly nonetheless. I've fixed this in version 8.12.2.