james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mariano Kamp <mariano.k...@gmail.com>
Subject org.apache.james.mime4j.io.MaxLineLimitException: Maximum line length limit exceeded / NPE
Date Sat, 04 Jan 2014 22:33:29 GMT
Hey guys.

I want to learn Hadoop and use my gmail mbox file as a basis for that.
That brought me to mime4j and for the most part this is working out great.
Thank you, btw.

But it took me a while to get my hands on a version of it. So I am
wondering if this project is still active? The download link [1] is broken.
Is this the official download link?

After some time I found apache-mime4j-*-0.8.0-SNAPSHOT.jars. But it is a
higher version number as the [official|outdated] 0.7.2 and it also seems
different then what I can see in the trunk. Or at least it seemed to me as
the DefaultMessageBuilder is not part of the trunk, but in 0.8.0.

Or maybe I am getting it all wrong, no idea. Tried to look at the sources,
but it seems then I also need to learn Maven – as it needs to generate
source – and I would rather spent my time on Hadoop.

Anyway, I ran into two issues, see subject.

It seems that Mime4j doesn't like long lines in the input and so the
parsing fails.

Here is such a long line that looks legit to me. At least it is not a
corner case as it is created by Google Groups.

References: <e38b04b3-5625-48d2-bbc9-33a7977269d1@googlegroups.com> <
afd247f5-47df-4367-acfa-b31e94b18dea@googlegroups.com> <
44152f22-3b3a-4137-aadb-d61151ceec13@googlegroups.com>
<BLU154-ds14D9F6B4BB5225A17450B0CCF80@phx.gbl> <
ae44f4eb-b3f4-4159-bed6-5dab479f0d54@googlegroups.com> <
5bbe5e89-3a1b-4e07-b339-9c719ed46aa5@googlegroups.com> <
181e5f61-9cee-4409-b6ca-cf62dc974e59@googlegroups.com> <
CALQcipbUU+Cp2memLx_7qS-hqmitQ9REM2kJhGDbp4YesU+xDA@mail.gmail.com> <
62124bf3-6830-4889-b982-505a047ef61d@googlegroups.com> <
6ae3238c-3b54-488d-bb80-51e35afdb960@hd10g2000pbc.googlegroups.com> <
8928045d-68fa-4bfc-98f1-7fddc24f7a3a@kt16g2000pbb.googlegroups.com> <
8ad18487-0d3d-4c6a-bba0-4286a2243dfd@googlegroups.com> <
fbd6f604-a703-401c-9546-a33f868c4b96@googlegroups.com>
<CALQcipYW4Qcwu5b1DhpZtXUHtCsVfjygPYosx7Sgt=FVb-3tag@mail.gmail.com> <
11f38d9f-6805-47f6-881a-2e6a623dffa4@googlegroups.com> <
2baf7a3d-4ec0-4bfd-972b-d5d7db84289c@googlegroups.com> <
e7e3f172-85cf-4f75-a178-e9093ad28be1@googlegroups.com> <413a
 1a0a-7fe0-41fd-a33e-3d880647ada0@googlegroups.com> <
2b700a14-0066-415c-b376-aca812aae3b3@googlegroups.com> <
82e4aa34-2c08-41bb-9970-34cf0bedde8a@googlegroups.com> <
405cc1fb-5eb2-4295-bd85-d7043866b182@googlegroups.com> <
4025bf45-ac66-4542-b116-d7eaaed33732@googlegroups.com>

Here is an excerpt from the stacktrace:
Caused by: org.apache.james.mime4j.io.MaxLineLimitException: Maximum line
length limit exceeded
at
org.apache.james.mime4j.io.BufferedLineReaderInputStream.readLine(BufferedLineReaderInputStream.java:218)
 at
org.apache.james.mime4j.io.LineReaderInputStreamAdaptor.readLine(LineReaderInputStreamAdaptor.java:78)
at
org.apache.james.mime4j.stream.MimeEntity.readRawField(MimeEntity.java:215)


I attached the full offending message. At the end of the message you'll
find the stacktrace.

But to put things in perspective. I processed my mails from the last ten
years (100k+) and it only had issues with a few hundred. So it's not a
biggie, but wanted to give you this feedback. And I can provide you with
more examples if you need those.

Furthermore I ran into a NPE as well.

java.lang.NullPointerException
at
org.apache.james.mime4j.io.MimeBoundaryInputStream.<init>(MimeBoundaryInputStream.java:67)
 at
org.apache.james.mime4j.stream.MimeEntity.createMimePartStream(MimeEntity.java:366)
at org.apache.james.mime4j.stream.MimeEntity.advance(MimeEntity.java:320)
 at
org.apache.james.mime4j.stream.MimeTokenStream.next(MimeTokenStream.java:368)
at
org.apache.james.mime4j.parser.MimeStreamParser.parse(MimeStreamParser.java:176)
 at
org.apache.james.mime4j.message.DefaultMessageBuilder.parseMessage(DefaultMessageBuilder.java:316)
at com.mboxanalytics.util.MboxUtil.parseMessage(MboxUtil.java:95)
 ...


UnsupportedEncodingException and IllegalCharsetNameException available as
well, but probably correct. Full list:

 RecordLevelErrors

 java.io.UnsupportedEncodingException/ISO-8859-8-I=1

 java.io.UnsupportedEncodingException/ansi_x3.110-1983=1

 java.io.UnsupportedEncodingException/csn_369103=1

 java.io.UnsupportedEncodingException/en.UTF-8=3

 java.io.UnsupportedEncodingException/iso-88592=4

 java.io.UnsupportedEncodingException/unicode-1-1-utf-7=3

 java.io.UnsupportedEncodingException/unknown-8bit=1

 java.io.UnsupportedEncodingException/us-as=1

 java.io.UnsupportedEncodingException/windows-1252http-equivCont=1

 java.io.UnsupportedEncodingException/x-utf8utf8=1

 java.lang.NullPointerException/null=1

 java.nio.charset.IllegalCharsetNameException/\"us-ascii\"=2

 java.nio.charset.IllegalCharsetNameException/iso-8859-1 Content=1

 java.nio.charset.IllegalCharsetNameException/windows-1252 chars=1

 org.apache.james.mime4j.MimeIOException/Maximum header length l=13

 org.apache.james.mime4j.MimeIOException/org.apache.james.mime4j=228

Success

 No of message successfully processed=129462

 No of words processed=64267035

Hope this is helpful and thanks again for providing this library.

Best,
Mariano

[1] http://james.apache.org/download.cgi#Apache_Mime4J

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message