An mbox mail file is contains plain emails concatenated in one big file. Since each mail starts with "From ", and ends with a newline, they can be separated from each other.
This class takes a mbox filename in the constructor, generates an index where the mails start and end when calling open() and returns single mails with get(), using the positions in the index.
With the help of this class, you also can add(), remove() and update() messages in the mbox file. When calling one of this methods, the class checks if the file has been modified since the index was created - changing the file with the wrong positions in the index would very likely corrupt it. This check is not done when retrieving single messages via get(), as this would slow down the process if you retrieve thousands of mails. You can, however, call hasBeenModified() before using get() to check for modification yourself. If the method returns true, you should close() and re-open() the file.
If something strange happens and you don't know why, activate debugging with setDebug(true). You also can modify the temporary directory in which changed mboxes are stored when adding/removing/modifying by using setTmpDir('/path/');
Determines if the file is automatically re-opened and its structure is parsed after modifying it. Setting this to false makes you responsible for calling open() by hand, but is *a lot* faster when appending many messages.
Directory in which the temporary mbox files are created.
Even if it's a unix directory, it does work on windows as the only function it's used in is tempnam which automatically chooses the right temp directory if this here doesn't exist. So this variable is for special needs only.