ConvertId : how to convert an IMAP messageId to an OWA id? RRS feed

All replies

  • You can't that ID is assigned by the MTA (or sending client) and doesn't really have anything to do with the Exchange Store the best you will be able to do is search for the message first using EWS then just use the WebClientReadorFormQueryString which will give you the properly format OWA url eg

                String MessageID = "<>";
                ItemView ivew = new ItemView(1);
                ExtendedPropertyDefinition PidTagInternetMessageId = new ExtendedPropertyDefinition(4149, MapiPropertyType.String);
                ExtendedPropertyDefinition exProp = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Common, 34070, MapiPropertyType.SystemTime);
                SearchFilter sf = new SearchFilter.IsEqualTo(PidTagInternetMessageId, MessageID);
                FindItemsResults<Item> iCol = service.FindItems(WellKnownFolderName.Inbox, sf, ivew);
                foreach (Item item in iCol.Items)
    Wednesday, February 15, 2012 9:32 AM
  • Hi Glen

    In Exchange 2003 I used to fetch the email URL by sending the messageId in a WebDAV request.

    (But I see that WebDAV is getting deprecated in later versions.)  Is there any other way I can get the http url of an email using IMAP MessageId alone?

    Wednesday, February 15, 2012 11:01 AM
  • >In Exchange 2003 I used to fetch the email URL by sending the messageId in a WebDAV request.

    EWS is what replaces WebDAV the code i posted above would do the same thing that WebDAV would you may actually find it better to rewrite whatever you doing with IMAP to use EWS as this is a more fully featured API.

    Thursday, February 16, 2012 4:31 AM
  • I tired this code sample with a Exchange 2007 SP1,  and got this The property null is valid only for Exchange Exchange2010 or later versions.

    "WebClientReadFormQueryString" is what is causing the issue.

    I am developing a POC,  so for now  I am planning to do something  like this

    for (Item item : iCol.getItems())
             ItemId itd = item.getId().getUniqueId();
             String convertedId = service.convertId(..) //another call to convert from EwsId to OwaId

    Note: I tried this using java api ( ) , but I think the behaviour will be the same in C# too..

    Thursday, February 16, 2012 8:40 AM