Q:

How do I change/set the ContentType of a detached signature with MimeKit?

When signing emails using MimeKit, the ContentType is set to application/pkcs7-signature.  
Our third party provider requires that the ContentType be set to application/x-pkcs7-signature.  
Is there an easy way to change/set this ContentType when signing the email using a detached signature with MimeKit?

A:

While the ContentType object is readonly, the MediaSubtype property is not.  
So using the following, I'm able to add the x- prefix that we require.
var part = SourceEmail.BodyParts.First(x => x.ContentType.MediaSubtype == "pkcs7-signature");

part.ContentType.MediaSubtype = "x-pkcs7-signature";

I also updated the overall Content-Type for the message.
var header = SourceEmail.Body.ContentType.Parameters.FirstOrDefault(x => x.Name == "protocol" && x.Value == "application/pkcs7-signature");

header.Value = "application/x-pkcs7-signature";

Omitted error checking for clarity.

