Environment is Sharepoint 2010. The issue I'm running into is essentially the one that occurred here: http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/f74ca4cb-44fe-4918-b206-b6616458a524 except that I am running a custom email event receiver instead of the native SharePoint one.
The section that handles the attachments happens here:
foreach (SPEmailAttachment attachment in emailMessage.Attachments)
{
byte[] attachmentArray = new byte[attachment.ContentStream.Length];
attachment.ContentStream.Read(attachmentArray, 0, (int)attachment.ContentStream.Length);
item.Attachments.Add(fileName, attachmentArray);
}
This code works fine for every attachment that I've tried, with the exception of .msg files. When any kind of .msg file is attached to an incoming email, no attachments appear and my event receiver logs an error that there were special characters that are not allowed in a file name. Even the most harmlessly named files like "a.msg" gives this error. Has anyone run into this problem with email attachments for an incoming email enabled list?