views:

326

answers:

3

We've written several Outlook Add-ins for various projects and have now been asked to look at writing a Exchange server add-in. We will need to inspect all incoming / outgoing msgs and tag / file them into a document management system. If it's a message that we are interested in we would ideally like to change the default icon that is displayed in Outlook. We could I guess settle for Categorising / colour coding the email but we've been asked for a icon.

Any guidance on how to get started / killer reference apps much appricaiated. Oh we will be needing to target both Exchange 2003 and 2007. VB.NET is our bag but were fine with C# too.

A: 

You can develop an Exchange 200x store sink and get called every time a messages is saved. It will not work for the sent items folder.
http://www.codeproject.com/KB/cs/csmanagedeventsinkshooks.aspx
http://support.microsoft.com/kb/297274

An other way is to set up a journal mailbox, have Exchange copy every message to it and periodically process and clear this mailbox. To tag the messages you would have to search the user mailboxes for archived items. Archiving directly from the user mailbox would miss messages the user deleted too soon.

Further options I'm aware of are SMTP event sinks and custom transport agents. The first one got removed in Exchange 2007, the second is not supported in Exchange 2003.

You have to find a way to recognize archived mails in the user mailbox and to avoid duplicates. I read someone suggesting to derive a SHA-1 from the message contents, but think using the PR_SEARCH_KEY and PR_INTERNET_MESSAGE_ID properties is an easier way. The internet message id is not reliable when Outlook is connected in cached mode. I noticed in Exchange 2007 that for incoming external mails the search key of the copy in the inbox is different from the search key of the copy in the journal.

Sebastian
A: 

I would add Stephen Griffin's blog to Matt's list

Hannes de Jager