I have previously used webdav to access the sent messages on an exchange 2003 server based on the subject and time and this has worked.
I now need to implement another feature which means dragging a message from client outlook (not web access) on to a windows form then querying webdav on exchange to get all the information about this message.
I can get the messages href using the following code:
Dim msg As MAPI.Message = CType(session.GetMessage(mail.EntryID), MAPI.Message)
Dim id as string = CType(CType(msg.Fields(), MAPI.Fields).Item(&H6707001E), MAPI.Field).Value.ToString
However there are two issues;
1) The encoding on the URL is different between what I get from the dragged message and what is brought back from webdav (I can see these if I ask for all mail).
2) No matter how I format the query it never brings back results even if I copy the href from the list when I bring back all messages.
Here is a sample of a search request that fails (works if you remove the where clause):
<?xml version="1.0" ?>
<D:searchrequest xmlns:D="DAV:">
<D:sql>SELECT "DAV:contentclass","DAV:href", "DAV:displayname","urn:schemas:httpmail:datereceived","urn:schemas:httpmail:subject"
FROM "https://server/exchange/mailbox" WHERE "DAV:href"='/Inbox/email.EML'</D:sql>
</D:searchrequest>
I have been using relative syntax as per this article but have tried many combinations.