2

I am trying to send an S/MIME encrypted email through a pre-defined email distribution system.

I give them a perfectly valid email, with all the right headers and correctly encrypted content.

The problem is, that the system rips the email apart and creates a new 'multipart/mixed' message from it, with the smime.p7m attached as an attachment.

Though Thunderbird somehow manages to encrypt the content the right way, others like Outlook don't and just show an empty message.

My question here is: Is is even possible to have the S/MIME message as part of a multipart message?

An example of how the newly created message looks like:

...
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="_=_swift_v4_1474547127_a48edcebcdce51b8c8f455_=_"


--_=_swift_v4_1474547127_a48edcebcdce51b8c8f455_=_
Content-Type: application/x-pkcs7-mime; smime-type=enveloped-data; name=smime.p7m
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7m

MIMDul4GCSqGSIb3DQEHA6CDA7pOMIMDukkCAQAxggJuMIICagIBADBSMEUxCzAJBgNVBAYTAkFV
...

--_=_swift_v4_1474547127_a48edcebcdce51b8c8f455_=_--
func0der
  • 2,192
  • 1
  • 19
  • 29

1 Answers1

2

Yes, you can have a application/x-pkcs7-mime as a subpart of a multipart/mixed. That is perfectly valid. There is no limitation on where an application/x-pkcs7-mime part must reside in the MIME structure.

jstedfast
  • 35,744
  • 5
  • 97
  • 110
  • Why is it then, that Outlook does not show any mail content at all and Thunderbird is not showing it "lock" icon to show that it is a encrypted mail? – func0der Sep 23 '16 at 17:40
  • Well, now you are asking about individual clients and what they support, but your original question was about what is allowed by the standards. Maybe those clients only support top level S/MIME. – jstedfast Sep 23 '16 at 20:54
  • That is correct. But I thought IF any clients is close to the standards its Thunderbird ^^ – func0der Sep 24 '16 at 20:31
  • I'm surprised Thunderbird doesn't handle it either, but *shrug* – jstedfast Sep 24 '16 at 20:35