Sicos1977 / MSGReader

C# Outlook MSG file reader without the need for Outlook
http://sicos1977.github.io/MSGReader
MIT License
478 stars 168 forks source link

Exception when trying to save third level .msg file to stream #260

Closed korhammer closed 3 years ago

korhammer commented 3 years ago

I have a .msg that contains a .msg which again contains a .msg.

MsgReader reads them correctly. However, when trying to save them to a stream, only the first two levels can be saved. For the third level saving to stream fails with:

CFItemNotFound> {"Cannot find item [__properties_version1.0] within the current storage"} at OpenMcdf.CFStorage.GetStream(String streamName) at MsgReader.Outlook.Storage.Message.Save(Stream stream)\r\n

Reproduce

  1. Create a .msg file with contains two more levels of .msg files.
    • root.msg
      • inner.msg
      • failing.msg
  2. Read with var msg = MsgReader.Outlook.Storage.Message(..);
  3. Save using msg.Save(new MemoryStream());