We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Processing Mbox using PersonalStorage


We are processing mbox extracts by first converting them to PersonalStorage using the following call:
PersonalStorage pst = MailStorageConverter.mboxToPst(inputStream,pstFieName);

This call has the undesired consequence of storing the .pst file on the disk. This impacts the performance as all our processing is done in-memory and we have no need for the .pst file. Moreover, this causes an issue for us as some of our environments (incl. CI) wouldn’t allow the program to “write” on the disk.

Can you please advise
1) if there is an interface that performs the mbox to PersonalStorage transformation without attempting to store the .pst file in the file system?
2) if there is any other way to process the mbox file without converting to .pst - where output files are not stored by Aspose libraries on to the file system.


Hi Shankar,

Thank you for writing to Aspose Support team.

1. There is no way to convert mbox to PST without storing the PST file to the system at present. Can you share if an overload method of mboxtoPst with outputStream argument will be sufficient for your needs in this case? We can then discuss this with our Product team for a possible implementation.

2. You can read the MBox file using MBoxrdStorageReader without converting it to PST and saving to disc. Please have a look at the following code sample for your kind reference. You can then process the mbox file, retrieve all messages one by one and dispose them after processing at your end.

Sample Code

FileInputStream stream = new FileInputStream(dataDir + “Outlook.mbox”);
try {
MboxrdStorageReader reader = new MboxrdStorageReader(stream, false);
try {
MailMessage msg;
String[] fromMarker = { null };
while ((msg = reader.readNextMessage()) != null) {
//process the message
msg = null;
} finally {
if (reader != null)
} finally {
if (stream != null)

Hi Kashif,

Thanks for the response.

1. The method in question already returns a PersonalStorage object which seems adequate for reading the contents. So, I don’t really need an OutputStream. However if you can provide an overloaded method that populates an outputstream object, that would be OK as I can simply ignore this object. My main concern is with Aspose library trying to write to the file system.

2. This option is useful, I shall check this out.



For your requirements, processing each message from MBox storage file using the MBoxrdStorageReader will be helpful. Please try it at your end and let us know if you need any further assistance in this regard.