Exceptions adding MapiMessage to PersonalStorage (FolderInfo.AddMessage)

We have noticed that FolderInfo.AddMessage is sometimes throwing exceptions adding MapiMessages. The problem is very complicated though, because we can only reproduce it when extracting a MapiMessage from one PersonalStorage and adding it to another PersonalStorage.

I do not believe the problem is related to the specific message that the exception is thrown on. I believe the problem may be related to the original PersonalStorage, or the amount of messages transferred into the destination PersonalStorage.

If we extract the same exception MapiMessage (just one) from the source PersonalStorage and save it out to disk, the message looks fine in Outlook. If we then load that same message and add it to a destination PersonalStorage, everything works fine - no exceptions. However, if we do the same code but with all messages from the source PersonalStorage and simply transfer the MapiMessages from the source PersonalStorage to a new destination PersonalStorage, sometimes we get the exception below on many messages.

I can send you the source PST, but it is 1.7GB. What is the best way to send to you? Do you have an FTP or SkyDrive or YouSendIt link I can upload to?

Call stack:
----------------------
2012-09-27 11:46:13,709 [2088] ERROR wave.common.Library.MailHelper.MailStore - Error adding message ‘FW: From The Enron India Newsdesk - June 6th newsclips’ to MailStore ‘C:\Trident Projects\kaminski\output\kamainski.pst’.
System.ArgumentOutOfRangeException: Index out of range. This is a single-block configuration
Parameter name: 1
at .?.e(Int32 )
at .?.(? )
at .?.(? )
at ...?.MoveNext()
at ...??.MoveNext()
at .…ctor(? , )
at ..(? )
at ..??(MapiAttachmentCollection )
at ..?(MapiMessage , FolderInfo )
at ..AddMessage(FolderInfo , MapiMessage )
at Aspose.Email.Outlook.Pst.FolderInfo.AddMessage(MapiMessage message)
at wave.common.Library.MailHelper.MailStorePST.add(MapiMessage msg, String folderpath)
----------------------
2012-09-27 11:46:13,737 [2088] ERROR wave.common.Library.MailHelper.MailStore - Error adding message ‘Don’t miss IIR’s Private Placements Summit!’ to MailStore ‘C:\Trident Projects\kaminski\output\kamainski.pst’.
System.ArgumentOutOfRangeException: Index out of range. This is a single-block configuration
Parameter name: 1
at .?.e(Int32 )
at .?.(? )
at .?.(? )
at ...?.MoveNext()
at ...??.MoveNext()
at .…ctor(? , )
at ..(? )
at ..??(MapiAttachmentCollection )
at ..?(MapiMessage , FolderInfo )
at ..AddMessage(FolderInfo , MapiMessage )
at Aspose.Email.Outlook.Pst.FolderInfo.AddMessage(MapiMessage message)
at wave.common.Library.MailHelper.MailStorePST.add(MapiMessage msg, String folderpath)
----------------------
2012-09-27 11:46:14,307 [2088] ERROR wave.common.Library.MailHelper.MailStore - Error adding message ‘RE: Follow up’ to MailStore ‘C:\Trident Projects\kaminski\output\kamainski.pst’.
System.ArgumentOutOfRangeException: Index out of range. This is a single-block configuration
Parameter name: 1
at .?.e(Int32 )
at .?.(? )
at .?.(? )
at ...?.MoveNext()
at ...??.MoveNext()
at .…ctor(? , )
at ..(? )
at ..??(MapiAttachmentCollection )
at ..?(MapiMessage , FolderInfo )
at ..AddMessage(FolderInfo , MapiMessage )
at Aspose.Email.Outlook.Pst.FolderInfo.AddMessage(MapiMessage message)
at wave.common.Library.MailHelper.MailStorePST.add(MapiMessage msg, String folderpath)
----------------------
2012-09-27 11:46:15,737 [2088] ERROR wave.common.Library.MailHelper.MailStore - Error adding message ‘FW: D-G Energy Software Procurement’ to MailStore ‘C:\Trident Projects\kaminski\output\kamainski.pst’.
System.ArgumentOutOfRangeException: Index out of range. This is a single-block configuration
Parameter name: 1
at .?.e(Int32 )
at .?.(? )
at .?.(? )
at ...?.MoveNext()
at ...??.MoveNext()
at .…ctor(? , )
at ..(? )
at ..??(MapiAttachmentCollection )
at ..?(MapiMessage , FolderInfo )
at ..AddMessage(FolderInfo , MapiMessage )
at Aspose.Email.Outlook.Pst.FolderInfo.AddMessage(MapiMessage message)
at wave.common.Library.MailHelper.MailStorePST.add(MapiMessage msg, String folderpath)
----------------------

Please note that we are using the new Aspose.Email 2.2 as well (we discovered this same issue in 2.1 as well).

Hi,


Thank you for using Aspose.Email.

Well, this seems to be a strange issue that may be the result of different reasons. We would request you to please spare us a little time so that we can carry out testing in this regard using different PSTs. We’ll share our findings soon here.

In case we fail to reproduce the issue at our end, then we will be in need of your PST files to look into this. I am not sure if skydriver or dropbox will allow to upload such a large file, but you can try it and provide us the download link on this thread for downloading. Please make sure to make this thread private once you decide to share any such personal information with us.

Here is a link to download the source .pst:
<span style=“font-size:12.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>http://www.yousendit.com/download/TEhYYUlyTERGOFJ3SGNUQw

Do not use the big green ‘Download’ button, just click on the link to the file. This data is not sensitive, it is publicly available ENRON data.

Please test with a loop that extracts each message from the source .pst and add it to a similarly named folder in the new destination .pst. You should see the exceptions we have posted above.

Hi,


We are sorry for delayed response.

We are still analyzing the issue and could not succeed in re-producing it here. We arranged a big PST file having about 6000 messages in it. We opened it using Aspose.Email for .Net 2.2.0.0 and copied all the mapi messages one by one to a newly created PST file. All the messages were written successfully to this new PST and no exception was raised.

It seems that issue is specif to the source PST so we request you to again share the online file so that we may download it and perform different tests to re-produce the issue.

We regret any inconvenience caused to you in this regard.

Just for your reference, I used the following code for testing:

static void Main(string[] args)
{
try
{
Console.WriteLine(“Loading PST file…”);

// load the Outlook PST file
PersonalStorage pst = PersonalStorage.FromFile(“EMAIL_416186\CMI Inbox 1.pst”);

// get the Display Name of the PST file
Console.WriteLine(“Display Name: " + pst.DisplayName);

// get the folders and messages information
FolderInfo folderInfo = pst.RootFolder;

// call the recursive method to extract msg files from each folder
ExtractMsgFiles(folderInfo, pst);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
private static void ExtractMsgFiles(FolderInfo folderInfo, PersonalStorage pst)
{
// display the folder name
Console.WriteLine(“Folder: " + folderInfo.DisplayName);
Console.WriteLine(”==================================”);

if (folderInfo.DisplayName == “MailsBox”)
{
// Create new PST
PersonalStorage DestPst = PersonalStorage.Create(“DestPST.pst”, FileFormatVersion.Unicode);

// Add new folder “Inbox”
DestPst.RootFolder.AddSubFolder(“MailsBox”);

//Get destination folder
FolderInfo DestFolderInfo = pst.RootFolder.GetSubFolder(“MailsBox”);

// loop through all the messages in this folder
MessageInfoCollection messageInfoCollection = folderInfo.GetContents();

foreach (MessageInfo messageInfo in messageInfoCollection)
{
// get the message in MapiMessage instance
MapiMessage message = pst.ExtractMessage(messageInfo);

// Add to destination folder
DestFolderInfo.AddMessage(message);
}
}

// call this method recursively for each subfolder
if (folderInfo.HasSubFolders == true)
{
foreach (FolderInfo subfolderInfo in folderInfo.GetSubFolders())
{
ExtractMsgFiles(subfolderInfo, pst);
}
}
}

Yes, as I said when I posted this thread, you should test with the source PST I provided.

Here is a new link (it will expire on Friday 10/12/2012):
<span style=“font-size:12.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>http://www.yousendit.com/download/TEhYZm1jNDIwZ24wZXNUQw

Please download it and test with it.

Also, for the record, your code that you tested with will only extract messages from a folder called “MailsBox”. Even though you call the function recursively, it will only extract messages from folders named “MailsBox”. Just letting you know.

Hi,

Thanks for providing supporting information. We are downloading the file and will test it once its done. Please spare us some time to analyze it and we will share our findings soon.

Thanks for your patience and understanding in this regard.
Hi,

Thanks for your cooperation and patience.

We have downloaded the file and tried copying messages from original PST "zl_kaminski-v_002.pst" to a newly created PST. We were able to re-produce the issue "Index out of range. This is a single-block configuration. Parameter name: 1". Now we have to log this issue but for this purpose sample PST is required whereas your provided link to the PST seems to expire tomorrow morning. We request you to please increase the time limit for the availability of this link, or share it at some other place for some time until our development team downloads it and investigates it further. Once you confirm us the availability of the file, we will log the issue in our issue tracking system.

We are sorry for any inconvenience caused to you in this regard.

I have extended the expiration for a month.

In the future you guys should seriously consider setting up one of these free skydrive/cloud accounts to accommodate us, your clients. Most developers who are processing OST/PST files are dealing with very large files, as modern day mail store files get large rather quickly.

Hi,


Thanks for providing assistance and being patient.

We have passed all the information to the development team and will write back you here as soon as some feedback is received.

We are sorry for any inconvenience caused to you and will make arrangements in future to manage huge files like this.

This issue is logged in our issue tracking system as NETWORKNET-33490.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)