'How to convert encrypted outlook msg file to smime.p7m in c# and vice versa?

I am using Microsoft.Office.Interop.Outlook to process a pst file. But there are some encrypted emails because of which I am not being able to open it. I am using EWS for synching exchange emails and I noticed that encrypted emails are shown as smime.p7m attachments. So I was wondering how OWA gets smime.p7m format for the msg file?? And also is there a way to convert smime.p7m file to outook msg file?

Thanks



Solution 1:[1]

Outlook Object Model always represents signed/encrypted messages as regular IPM.Note MailItem objects.

To get to the underlying p7m attachment, you can either use Extended MAPI (C++ or Delphi only) or Redemption (any language - I am its author) - it exposes the RDOEncryptedMessage object.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1