Home How to display and store decrypted mailItem in Outlook
Reply: 0

How to display and store decrypted mailItem in Outlook

user5164 Published in September 19, 2018, 3:42 am

I am developing an Outlook-AddIn that automatically decrypts emails. So basically, the AddIn changes some MailItem properties (subject, body, attachments) when new mail arrives. The problem is that when I save the item then the decrypted message is synchronized with the server, which is really bad for end-to-end-encryption... If I don't save the item, then the explorer pane still shows the encrypted message and searching for emails (decrypted subject or body) does not work.

My question is: How can I display and (locally) store the decrypted mailItem, so that all the usual features like email searching still work? Is there a way to stop synchronization for specific emails in .ost?

One solution that I came up with is to store a copy of the MailItem in a local .pst store. But in that case the user has to handle the messages in two different stores (.ost and .pst), which is not very user friendly. The requirement is that the user has to change his usual behaviour as little as possible when reading emails.

private void Outlook_NewMailEx(object Item)
        Outlook.MailItem mailItem = Application.Session.GetItemFromID((string)Item);

        if (mailItem != null)
            // decrypt the mailItem
            mailItem.Subject = "decrypted subject";
            mailItem.Body = "decrypted body";

            // save mailItem LOCALLY
            // (don't synchronize the decrypted message with the server)

I would be grateful for any help!

share|improve this question

1 Answer 1

active oldest votes
up vote 1 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.278462 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO