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

Use default storage for attachments #9

Open ideaplugins opened 5 years ago

ideaplugins commented 5 years ago

All attachments are kept in memory. This is a blocker for my needs of parsing big emails. I'm working on this and I'll submit a PR soon

ram-sharma-6453 commented 5 years ago

Thanks for using the library and informing me about the PR.

Since the library uses the mime4j storage ,

I would recommend you to look into the following interfaces and classes for your understanding and including the functionality as suggested by you :

  1. org.apache.james.mime4j.storage
  2. org.apache.james.mime4j.storage.StorageProvider
  3. tech.blueglacier.storage.AbstractStorageProvider
  4. tech.blueglacier.storage.MemoryStorageProvider
  5. org.apache.james.mime4j.storage.DefaultStorageProvider
  6. org.apache.james.mime4j.storage.TempFileStorageProvider

My needs of the time (primarily to return size of the attachments) prompted me to implement in memory solution,

Kindly look into the already implemented interfaces provided by 'mime4j storage' to fulfill your requirements.

I will integrate the 'big email' support in subsequent release.

Try adding sample of the 'big emails' that you are parsing so that I could integrate them in my test cases.

Keep me posted if you run in into any issues and require help.

ram-sharma-6453 commented 5 years ago

Will review the pull request and then merge.