EMail Business Service with eMail signature validation


a Customer of ours comes up with a requirement to improve an existing email business service within one of his ensemble productions. The services fetches emails from a mailserver on a daily basis and extract attached files from this email and send them along with some meta information through the production.

The sender of the email uses email signatures (which is embedded as smime.p7s). This gives us some problems when consuming this email. As a temporary workaround the email server forward the email to itself to remove the signature (which isn´t embedded when emails are forwarded). To get rid of this workaround and to have the additional feature to validate the email signature I am looking for a good starting point.

Extracting the signature file smime.p7s from the %Net.MailMessage might be the start, next step would be to verify the signature with the senders vertificate. Does anyone has already done such a thing?

I am grateful for any hints on a workflow for doing this and further points to consider.

Best regards,


  • 0
  • 112
  • 2
  • 1




after looking into the example and some local testing I found this is what I am looking for. Anyway one of the major points in my opinion is to deseriialize the email into a stream, write this one into a file an pass it to the oppenssl command and parse the result. Are there any suggestions for the step of deserialization the email with it´s entire contents to a stream? The api seams at least not the have a direct method(s) for this. Hof can this be achieved?

Best regards,