ram-sharma-6453 / email-mime-parser

A mime4j based simplified email mime parser for java
Apache License 2.0
46 stars 16 forks source link

org.apache.james.mime4j.MimeException: org.apache.james.mime4j.io.MaxLineLimitException: Maximum line length limit (1000) exceeded #7

Closed yashthakur1 closed 5 years ago

yashthakur1 commented 5 years ago

org.apache.james.mime4j.MimeException: org.apache.james.mime4j.io.MaxLineLimitException: Maximum line length limit (1000) exceeded --

This above issue occurs when mime type html email data is parsed.

exception occurs on the following line : mime4jParser.parse(mailData);

Kindly look into the issue, we need to extract html rendered body from the raw email data.

Dacesilian commented 5 years ago

According to this hint, you can make your own MimeConfig class, but that class is final so it's not so easy. But you can also use this and it has infinite line length limit and so works:

MimeConfig mime4jParserConfig = MimeConfig.PERMISSIVE;

yashthakur1 commented 5 years ago

Sure will give it a try and update here, Also one use case i found is, when the email data is raw email which i directly pasted from Gmail's view original section. The parsing works properly. Whereas when the email data is raw email and contains \r\n in between, which is a text/plain mime type the parsing throws the above error. Any thoughts on that ? @Dacesilian @ram-sharma-6453

ram-sharma-6453 commented 5 years ago

Can you please share the raw email that is giving you trouble, I would look into that particular case .

ram-sharma-6453 commented 5 years ago

Requested information not received, Closing it.