简体   繁体   中英

mailkit.net/mimekit.net Get original Message from Multipart/Signed Message

I have a Multipart/Signed message and can verify it. 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?

The original message body is just the first child of the MultipartSigned part.

I'm presuming here that the multipart/signed part is the toplevel part of the message (which is typically the case):

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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