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
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.
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.
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.
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.
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.
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.
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.
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