views:

690

answers:

2

Hi all,

We're using Exchange 2007 WS to process mail folders and are hitting various problems if we try and forward a message we've already received. Our process is:

  • Windows Service monitors mailbox folder, on finding a new mail we process the information and move the item to a 'Processed folder' and store the Exchange Message Id.
  • Users may opt to forward the mail externally. We use the Exchange API to find the item using the Message Id we stored earlier, and then again use the API to forward.

Except finding the mail again is proving rather flakey. We regularly get the following error:

'The specified object was not found in the store.'. Is there a better/more reliable way we can achieve the same ? The doco for Exchange WS is rather sparse....

+1  A: 

Are you saving the Message ID of the newly found message or the message once it has been moved to the 'Processed' folder? The id will change when it moves to a new folder.

The method recommended in the book Inside Microsoft Exchange Server 2007 Web Services is to grab the PR_SEARCH_KEY (0x300B, Binary) of the newly discovered item, then move it to the 'Processed' folder. You can then search for it in the new folder based on the PR_SEARCH_KEY and get it's new Message id to forward it.

Joe Doyle
A: 

This is a bug in microsoft exchange manage API. here is a link for more information http://maheshde.blogspot.com/2010/09/exchange-web-service-specified-object.html