Samples and Original Text attached in files.
We are trying to convert some eml files using the MapiMessage.FromMailMessage method. We set the MapiConversionOptions.PreserveSignature to true.
If we try to convert an EML file that represents a clear signed SMIME message, an opaque signed SMIME message, or an encrypted SMIME message, then the conversion is success full and we can open the resulting MSG files using Microsoft Outlook correctly.
However, if we have a EML file that represents a normal message but with an embedded message attachment that is either a clear signed SMIME message, an opaque signed SMIME message, or an encrypted SMIME message, then the resulting converted MSG is not correct. When opening the resulting MSG files using Outlook, the embedded messages do not have the correct structure. For example, we don’t see the signature information that Outlook usually displays. And sometimes the whole body is missing. It seems that MapiConversionOptions.PreserveSignature applies to the root message, but no to the embedded ones.
We attach the sample EML files. Here is the code that we use:
var mailMessage = MailMessage.Load("c:\\test\\Aspose test cases\\Normal Message With Signed And Encrypted.eml");
var mapiConversionOptions = MapiConversionOptions.UnicodeFormat;
mapiConversionOptions.PreserveSignature = true;
var msg = MapiMessage.FromMailMessage(mailMessage, mapiConversionOptions);
msg.Save("c:\\test\\Aspose test cases\\results\\Normal Message With Signed And Encrypted.msg", SaveOptions.DefaultMsgUnicode);