none
Outlook 2010/2013 modifying content-type RRS feed

  • Question

  • I am developing an Outlook add-in with C#, VSTO and I want to implement PGP/MIME support.

    I want to send an email with "content-type=multipart/encrypted" in its header part, but Outlook changes this to "multipart/mixed" when sending.

    My current implementation (for testing purposes) works like this:

    * In the Send event of the mail item, I export it via Redemption to *.eml

    * I process the eml so that there are two attachments "PGP mime version identification" and "encrypted.asc" and the content-types are set correctly to "multipart/encrypted", "application/pgp-encrypted" and "application/octet-stream".

    * After I imported and sent this modified eml file the content-type of the email is changed to "multipart/mixed" and an additional MIME part without content is inserted.

    How do I prevent Outlook in doing this?

    Thanks in advance
    AlexStrobel

    Wednesday, July 8, 2015 2:16 PM

Answers

All replies

  • I don't think you'd be able to do that unless you take over the message submission (e.g. by directly talking to the outgoing SMTP server).


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, July 8, 2015 2:52 PM
  • Thanks for your answer, do you know some ressources to this topic? (Talking SMTP)

    I am hoping that someone at Microsoft (Outlook/Exchange Developer) is reading this topic and fixes this bug. In the Exchange documentation[1] the content-type "mutlipart/entcrypted" is explicitly listed. But Exchange and Outlook are screewing it up, when you try to set it. This is really annoying...

    [1] https://msdn.microsoft.com/en-us/library/office/aa493937%28v=exchg.140%29.aspx?f=255&MSPPError=-2147217396

    Thursday, July 9, 2015 1:04 PM
  • There is very little control over the MIME structure of the outgoing messages in Outlook. You can (in theory) abort the message submission in the Application.ItemSendEvent, create the appropriate MIME message, then use straight SMTP to send the message through Exchange. Any SMTP library as long as it supports TLS should work.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Thursday, July 9, 2015 3:12 PM