FIX: Multipart attachments parsing

Apr 22, 2008 at 1:13 AM
1. Thanks for providing this handy library.
2. Below is a fix for:

ImapCommand.cs
......
private ImapMessageBodyPartList BodyPartSplit(string response)
...
// Parse nested body parts
if (response.Substring(index, next - index).StartsWith("(("))
{
//BROKEN ImapMessageBodyPartList temp = BodyPartSplit(response.Substring(index, next));
//FIX is on next line.
ImapMessageBodyPartList temp = BodyPartSplit(response.Substring(index, next - index));
for (int j = 0; j < temp.Count; j++)
{
tempj.BodyPart = count.ToString() + "." + tempj.BodyPart;
Parts.Add(tempj);
}
}
else
{
ImapMessageBodyPart Part = new ImapMessageBodyPart(response.Substring(index, next - index));
Part.BodyPart = count.ToString();
Parts.Add(Part);
}
------------------------
I found this while writing a small program to fetch certain mail messages that have multiple parts - anywhere from 3 to 9 or more.
------------------------
Apparently there are no other free IMAP .NET libraries out there. I searched for several hours.
Thanks again.
Coordinator
May 20, 2008 at 9:55 PM
Thanks for the patch.