I’m processing a signed email using aspose. I tried the msg.RemoveSignature(); method on a message that has property of IsSigned = true, but that property stays the same. How do I get the message IsSigned property to say false so that I can download the message and open it in outlook without error message like “an error occurred in the underlying security system”.
Can you please provide us with an signed email sample you are using in your test? We will check it on our side and investigate the cause of this problem.
Attached is the email created after using aspose to ingest the email in the 1st attachment. This email is the one we cannot open with outlook. NCATS_PA_3095_Source.zip (1.9 MB)
Please remember that the RemoveSignature method creates a new instance of the unsigned message. See code samples:
//if you are using MailMessage
MailMessage eml = MailMessage.Load("test a signed email for K2 ingestion.msg");
MailMessage unsignedEml = eml.RemoveSignature();
bool signed = eml.IsSigned;//true
signed = unsignedEml.IsSigned;//false
//if you are using MapiMessage
MapiMessage msg = MapiMessage.Load("test a signed email for K2 ingestion.msg");
MapiMessage unsignedMsg = msg.RemoveSignature();
signed = msg.IsSigned;//true
signed = unsignedMsg.IsSigned;//false
Hello there,
Here is a snippet of the code. We send digitally signed email to a shared mailbox using online exchange, move the email to a folder named “Load to Intake” and use the code to save the signed email to local folder. Opening the saved email gives the error.
NetworkCredential credentials = new OAuthNetworkCredential(accessParameters.UserName, accessToken);
var client = EWSClient.GetEWSClient(exchangeUri, credentials);
ExchangeMailboxInfo exchangeMailboxInfo = client.GetMailboxInfo(sharedMailbox); //sharedemail@domain.com
ExchangeFolderInfoCollection folderInfoCollection = client.ListSubFolders(exchangeMailboxInfo.InboxUri);
string loadIntakeUri = "";
string processedUri = "";
foreach (ExchangeFolderInfo folderInfo in folderInfoCollection)
{
// Call the recursive method to read messages and get sub-folders
if (folderInfo.DisplayName == "Load to Intake")
{
loadIntakeUri = folderInfo.Uri;
}
else if (folderInfo.DisplayName == "Processed")
{
processedUri = folderInfo.Uri;
}
}
ExchangeMessageInfoCollection msgCollection = client.ListMessages(loadIntakeUri, false);
foreach (ExchangeMessageInfo msgInfo in msgCollection)
{
if (msgInfo.Subject == "test a signed email for K2 ingestion")
{
String strMessageURI = msgInfo.UniqueUri;
Aspose.Email.MailMessage msg = client.FetchMessage(strMessageURI);
msg.Save("C:" + "\\" + "Message_out" + timestamp + ".msg", Aspose.Email.SaveOptions.DefaultMsgUnicode);
}
}
@rusty02
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): EMAILNET-41205
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Hi @rusty02
We were unable to reproduce this issue in the latest version of the Aspose.Email API. But we noticed that such an error occurred before in older versions. Please try the latest version of Aspose.Email 23.10 and give your feedback.
Hello @alexander.pavlov ,
I have tried updating to the lastest ASPOSE.Email version 23.10 and I’m still having the same issue. Have you tried the code I pasted?
Hi @rusty02
We’ve uploaded your signed message file to our server and ran your example code to receive the message. If we used Aspose.Email dll version 23.5 (and earlier) we get the same error, but since Aspose.Email dll version 23.6 (and later) this bug has been fixed and there are no errors. Both result files are attached here. Also, when analyzed using SSView, it is clear that the structure of the file obtained using version 23.5 differs from the original one, and starting from version 23.6 it is the same as the original one (see screenshots).
So, we see that this error has been fixed and we ask you to double-check which version of Aspose.Email you were using. test a signed email for K2 ingestion.msg_saved_AE_23_5.zip (1.9 MB)
Hello @alexander.pavlov ,
I tried using Apose.Email.dll version 23.6 and 23.10 both gave me the same result with a message i can’t open (see attachment). I’ve attached the sourcecode and the email it generated. Please review and let me know what I should try next.