Free Support Forum - aspose.com

MboxrdStorageReader fails to read MBOX file using Aspose.Email for JAVA API


#1

Hello Team,


I have to read MBOX file by using aspose MBOX reader(MboxrdStorageReader). But Aspose MBOX reader is not read any mail from MBOX file. Actually there are 16 mails in the MBOX file. Aspose reader fails to read mails from MBOX file. Please refer below source code and above mbox attachment for you testing purpose.

******** Source Code *******

MboxrdStorageReader objMBOXReader = null;

try
{

objMBOXReader = new MboxrdStorageReader(this.m_StrSourceFilePath, true);


int f_intMailCount = 0;


while ((f_objMailMessage = objMBOXReader.readNextMessage()) != null //iterate mails

{

try

{

f_intMailCount++;

}

catch(Exception pObj)

{

pObj.printStackTrace();

}


}//end of while loop


}//end of outer try

catch(Exception pObj)

{

pObj.printStackTrace();

}

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco} p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Monaco}

#2

Hi Ajinath,


Thank you for contacting Aspose support team.

This issue is re-produced and logged under Id: EMAILJAVA-34262 for further investigation by the product team. You will be automatically notified once any update is received in this regard.

#3

Hello Kashif Sir,


What about this issue. Give us solution for this issue i have purchase Aspose License. I have waste more time on it.

#4

Hi Ajinath,


At present, there is no update available with respect to resolution of this issue. We’ll let you know once the issue is fixed or some other information worth sharing with you is available in this regard.

#5

The issues you have found earlier (filed as EMAILJAVA-34262) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

#6

i am trying to read mbox file but it shows mailcount 0.
here is the file : MboxFile1.zip (2.5 MB)
i am using aspose.email in java latest version.


#7

@praw,

Thank you for contacting Aspose Support.

We were able to reproduce the issue reported by you and have logged a ticket in our issue tracking system as EMAILJAVA-34481 to investigate it further. We will update you here as soon as additional information is available.


#8

i have a query regarding mbox file, I want the position of every frommarker in mbox file so that i can directly jump on that location to read eml file.
Is there any method for this in aspose.email in java.


#9

@praw,

We regret to share that this feature is not present in the API at the moment. However, we have logged an investigation ticket as EMAILJAVA-34482 in our issue tracking system to investigate the feasibility of this feature. We will update you here as soon as additional information is available regarding this.


#10

@praw,

According to our understanding, something like this will fulfill your requirements. Please check and share your feedback with us.

//For example:

MboxrdStorageReader mbox = new MboxrdStorageReader("MboxFile1.mbx", false);

// read markers collection
MboxFromMarker[] markers = mbox.readMarkers();
// print marker string
System.out.println(markers[3].getMarker()); //From - Wednesday, June 12, 2013
// move to marker and read message
mbox.moveToMarker(markers[3]);
MailMessage message = mbox.readNextMessage();

#11

// read markers collection
“MboxFromMarker[] markers = mbox.readMarkers();”

this function is not working in aspose.email in java.


#12

@praw,

The example code shared in the previous message is not part of the API. It was shared to understand your requirements better. If something like this was implemented in the API, will it fulfill your requirements? If so, then this might be added to the API in a future release. Please share your feedback and suggestions regarding this feature implementation.


#13

Will this code give help me to extract eml data from one frommarker to another one, if it will do that then this feature is usefull for me.


#14

@praw,

Thank you for sharing your feedback.

We will update you here as soon as additional information regarding feature implementation is available.


#15

@praw,

Please provide additional details regarding this requirement. We have shared some example code snippets according to our understanding of your requirements.

// Example 1

MboxrdStorageReader mbox = new MboxrdStorageReader("MboxFile1.mbx", false);

// Read markers collection
MboxFromMarker[] markers = mbox.readMarkers();

// Read all messages for June 12
for (MboxFromMarker item : markers) {
   if (item.getMarker().contains("June 12")) {
       mbox.moveToMarker(item);
       MailMessage message = mbox.readNextMessage();
   }
}

// Read all messages for 2013
for (MboxFromMarker item : markers) {
   if (item.getMarker().contains("2013")) {
       mbox.moveToMarker(item);
       MailMessage message = mbox.readNextMessage();
   }
}
// Example 2
// You can control the "frommarker" position.

MboxrdStorageReader mbox = new MboxrdStorageReader("MboxFile1.mbx", false);

mbox.moveToMarkerByLineOffset(lineOffset);
MailMessage message = mbox.readNextMessage();
// or
mbox.moveToMarkerByByteOffset(byteOffset);
MailMessage message = mbox.readNextMessage();

Please check if these will fulfill your requirements and share your feedback. You may also share your own version of the code.


#16

The issues you have found earlier (filed as EMAILJAVA-34481) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by muhammadahmad