How to read Internet Headers using WebDAV

We can get Internet Headers/Message Headers via WebDAV using PR_TRANSPORT_MESSAGE_HEADERS MAPI property.

PidTagTransportMessageHeaders Canonical Property

https://msdn.microsoft.com/en-us/library/cc815628.aspx

PR_TRANSPORT_MESSAGE_HEADERS
https://schemas.microsoft.com/mapi/proptag/0x007D001F

 

Here is VBScript sample with WebDAV PROPFIND request.

NOTE: Following programming examples is for illustration only, without warranty either expressed or implied,
including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose.
This sample code assumes that you are familiar with the programming language being demonstrated and the tools used
to create and debug procedures.

 

 Dim objX, strR, strRes
 Set objX = CreateObject("Microsoft.XMLHTTP")
 'Change Item URL, Domain, User, Password
 objX.Open "PROPFIND", "https://server/exchange/user/Inbox/Item123.EML", FALSE, "Domain\User", "Password"
 strR = "<?xml version='1.0'?>"
 strR = strR & "<d:propfind xmlns:d='DAV:' xmlns:m='urn:schemas:mailheader:' "
 strR = strR & "xmlns:e='https://schemas.microsoft.com/exchange/' xmlns:p='https://schemas.microsoft.com/mapi/proptag/'> "
 strR = strR & "<d:prop><d:displayname/><p:0x007D001f/></d:prop></d:propfind>"
  
 objX.SetRequestHeader "Content-type:", "text/xml"
 objX.SetRequestHeader "Depth", "1"
 objx.SetRequestHeader "translate", "f"
 objX.send(strR)
  
 strRes = objX.responseText
 Msgbox strRes

 

And following is sample WebDAV SELECT request.

 <?xml version="1.0"?>
 <D:searchrequest xmlns:D = "DAV:">
 <D:sql>SELECT "urn:schemas:mailheader:to", https://schemas.microsoft.com/mapi/proptag/0x007D001F, "urn:schemas:httpmail:subject" FROM "/exchange/user/Inbox/" 
 WHERE "DAV:ishidden" = false AND "DAV:isfolder" = false</D:sql>
 </D:searchrequest>

 

Please also refer the article mentioned below related to supportability of working with MAPI properties

The Support Guidelines for Client-Side Messaging Development
https://support.microsoft.com/kb/266353
Refer Section: Integrating with Outlook properties