Sicos1977 / MSGReader

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

Inline Attachments embedded in RTF Mails are corrupted #402

Closed dominik1996 closed 5 months ago

dominik1996 commented 5 months ago

Describe the bug Inline Attachment embedded into RTF Mails seem to be corrupted when exporting them. Attached is one of our Files (Beispiel-E-Mail RTF.zip) (as MSG in Zip).

To Reproduce Steps to reproduce the behavior:

  1. Using the sample Code below we extract the content of the Attachment.
  2. We then convert this to base64 or export it as file
  3. Neither the base64 string nor the exported file is valid (exported file won't open (on Windows) since it is corrupted)
var message = new Storage.Message(fileStream);
var attachmentsToExport = message.Attachments.OfType<Storage.Attachment>().ToList();

var attachment = attachmentsToExport.First();

// We then use attachment.Data to convert to base64 or to export as file
// File.WriteAllBytes(..)
// Convert.ToBase64String(..)

Expected behavior As in Version 5.2.5 the images should be extracted correctly. 5.2.5 is the last Version that is working for us.

Desktop (please complete the following information):

Additional context As described we receive an error while trying to open the file after export: image

Sicos1977 commented 5 months ago

I tried your example file but that one is working fine for me... the attachment is also extracted correctly.

Sicos1977 commented 5 months ago

No response... closed