简体   繁体   English

mailkit.net/mimekit.net 从多部分/签名消息中获取原始消息

[英]mailkit.net/mimekit.net Get original Message from Multipart/Signed Message

I have a Multipart/Signed message and can verify it.我有一个 Multipart/Signed 消息并且可以验证它。 Now I need to access the original Message to be able to access the attachments.现在我需要访问原始消息才能访问附件。 Is there a way to access the original Message after the Verification happened and how would you do it using mailkit.net/mimekit.net?验证发生后有没有办法访问原始消息,您将如何使用mailkit.net/mimekit.net 进行访问?

The original message body is just the first child of the MultipartSigned part.原始消息正文只是 MultipartSigned 部分的第一个子项。

I'm presuming here that the multipart/signed part is the toplevel part of the message (which is typically the case):我在这里假设 multipart/signed 部分是消息的顶级部分(通常是这种情况):

var body = message.Body;

if (body is MultipartSigned signed) {
    // do your verification as you've already done...

    // update 'body' to point to the original message body
    body = signed[0];
}

// process 'body' as if it was the body of the message

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM