You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've discovered something when saving attachments from outlook .msg files.
If the attachment is itself a .msg compound file, you represent it as a Storage.Message instance, which is great. When I call .Save() on such an instance, you create a new CompoundFile (see Message.cs line 1896) and copy the relevant streams and properties over. So far so good.
I have however been alerted to the fact an email scanner is detecting issues with such saved message files if they are sent as attachments. Having carefully varied the versions of this library and the referenced OpenMcdf library, I was able to narrow the issue down to a change in OpenMcdf version 2.2.1.9 which no longer initialises the CLSID of a storage - in this case the new root - to a non-empty GUID.
Apparently this makes the OpenMcdf implementation more compliant, but a side effect is that such attached .msg files are now saved with a root-level CLSID of 00000000-0000-0000-0000-000000000000 instead of the random new GUID previously. I believe that the correct value would be CLSID_MailMessage: {00020D0B-0000-0000-C000-000000000046}.
I think a solution would be to set this CLSID in the root storage of the new compound file when creating it. Maybe around line 1898. Maybe you have a better solution.
As a workaround, I'm loading the file saved from the attached .msg into a CompoundFile, setting the CLSID and resaving. This has resolved my issue with the mail scanner.
The text was updated successfully, but these errors were encountered:
Good to hear that the issue is solved by adding the GUID. If you did not make an issue for this I would never have known that this was a new issue because of some changes in OpenMCDF
Hi, I've discovered something when saving attachments from outlook .msg files.
If the attachment is itself a .msg compound file, you represent it as a
Storage.Message
instance, which is great. When I call.Save()
on such an instance, you create a newCompoundFile
(see Message.cs line 1896) and copy the relevant streams and properties over. So far so good.I have however been alerted to the fact an email scanner is detecting issues with such saved message files if they are sent as attachments. Having carefully varied the versions of this library and the referenced OpenMcdf library, I was able to narrow the issue down to a change in OpenMcdf version 2.2.1.9 which no longer initialises the CLSID of a storage - in this case the new root - to a non-empty GUID.
Prior to OpenMcdf 2.2.1.9, the CLSID was assigned a new GUID. See ironfede/openmcdf#68 and ironfede/openmcdf@949e5ce.
Apparently this makes the OpenMcdf implementation more compliant, but a side effect is that such attached .msg files are now saved with a root-level CLSID of 00000000-0000-0000-0000-000000000000 instead of the random new GUID previously. I believe that the correct value would be CLSID_MailMessage: {00020D0B-0000-0000-C000-000000000046}.
I think a solution would be to set this CLSID in the root storage of the new compound file when creating it. Maybe around line 1898. Maybe you have a better solution.
As a workaround, I'm loading the file saved from the attached .msg into a
CompoundFile
, setting the CLSID and resaving. This has resolved my issue with the mail scanner.The text was updated successfully, but these errors were encountered: