micronode / mstor

Messaging store and archival tool
https://www.mstor.org
Other
11 stars 2 forks source link
email java javamail mbox-format nio storage

mstor - email storage and archiving

Table of Contents

  1. Introduction - What is mstor?
  2. Concepts
  3. Configuration options
  4. Reference - Specification
  5. Limitations - memory usage, etc.
  6. Development - Guide for contributing to the mstor project

Introduction

Mstor is a JavaMail provider for persistent email storage. mstor builds on the mbox format and provides the following benefits:

Concepts

Metadata

By default mstor provides the ability to extend the standard JavaMail features through the use of metadata. This metadata is stored in an XML-based document for each folder in the store. Current metadata includes the following:

Mbox File Encoding

The mbox format is essentially a concatenation of RFC822 (or RFC2822) messages with an additional "From" line inserted at the start of each message. Instances of "From" within the message body are also escaped with a preceding ">" character.

Although mstor doesn't encode/decode message content (it is assumed appended messages are valid RFC822 messages), we still need to use an encoding to interpret and create the "From_" line.

Because mbox is just RFC822 messages, file encoding should always be "US-ASCII", however JavaMail seems to use "ISO-8859-1" encoding and as such mstor will also use this encoding as the default.

It is possible however, to override the mbox file encoding used by specifying the following system property:

 `-Dmstor.mbox.encoding=<some_encoding>`

Configuration

System Properties

A number of system properties may be specified in order to configure the operation of mstor to suit your purpose. These are as follows:

References

Specifications

Limitations

OutOfMemoryError

You may encounter errors when trying to load a large mailbox into memory all at once. Here are some pointers to help avoid this problem:

Development

How to build

Using Maven:

If you have downloaded the source distribution, you should be able to package a JAR file simply by running maven in the root directory. e.g:

C:\Libs\mstor-0.9.12-src>mvn package

Using Ant:

If you have downloaded the source distribution, you should be able to package a JAR file simply by running ant in the root directory. e.g:

C:\Libs\mstor-0.9.12-src>ant

If for some reason you would like to override the default build classpath, I would suggest creating a "build.properties" file (see the provided sample) in the root directory and add overridden properties to this. You can also override properties via Java system properties (e.g. -Dproject.classpath="..."). You shouldn't need to modify the "build.xml" at all, so if you do find a need let me know and I'll try to rectify this.