Search code examples
emailmimemime-message

Verifying/testing the output of mime4j parsed content


I am creating a tool that is required to parse incoming MIME streams and return the email body and email attachments as separate file streams.

I am using mime4j for this purpose.

Following are the problems that I am stuck on:

  1. How can I test whether the email body file or email attachment file that I parsed out via mime4j from MIME stream is correct?

I have a large corpus of emails available in raw mime form that I want to run my tests on and need some automated way to determine which ones might be breaking the mime parsing by mime4j and tweak the code for that.


Solution

  • I initially parsed out a sample corpus *.eml files using mime4j. I had to manually check them for parsing errors as I had no other good choice.

    Now I am using the earlier parsed out emails as testbed over which I check my parsed out results iteratively.