InfiniTec - Henning Krauses Blog

Don't adjust your mind - it's reality that is malfunctioning

Private items with WebDAV

Outlook allows an item to be marked as private. For example, if Alice defines an appointment as private in her calendar and Bob, who has read access to Alice's calendar tries to read it, he won't get the details of that appointment. So while he technically has read access to that appointment, Outlook will block out the details. Note that Outlook is the instance which blocks out the instance. Using another protocol like WebDAV allows Bob to see the details.

This private flag can be read and written via WebDAV, but it's somewhat complicated. These are the relevant properties for the so called sensitivity of an item:

  • PR_SENSITIVITY (http://schemas.microsoft.com/mapi/proptag/0x360003)
  • Private Flag (http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8506)
  • The Sensitivity header (urn:schemas:mailheader:sensitivity)

Reading or searching this property is easy: Just use the PR_Sensitivity with a SEARCH or PROPFIND request, and it will be returned as an integer value, which has this meaning:

  • 0: Normal
  • 1: Personal
  • 2: Private
  • 3: Confidential

You can also search for the private flag, which is a boolean value. If it's true, the item is marked private.

As far as I know, Outlook uses only the value 0 and 2.

If you want to set this value, you can just set this property do the desired value. That is, unless you want to clear the flag and set it to 0. This won't work. You have to set the sensitivity mail header to get this working. This is a string property, which must be set to one of these values:

  • Normal
  • Personal
  • Private
  • Company-Confidential

Searching for private items

As I mentioned above, you can search for items with a certain sensitivity. But since the properties are not part of the default item schema, you'll have to cast them to their datatypes. For example, to search for items marked as private using the Private flag, you can use this restriction in the WHERE clause of a SEARCH request:

    1 ("DAV:isfolder" = false) AND Cast("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/0x8506" as "boolean") = true

 


Technorati:

Posted by Henning Krause on Tuesday, October 30, 2007 12:00 AM, last modified on Tuesday, October 30, 2007 12:00 PM
Permalink | Post RSSRSS comment feed

Comments (2) -

On 10/28/2008 5:08:42 PM Paul United Kingdom wrote:

Paul

Cheers for this, I'd been banging my head against a wall for an hour or so trying to figure out the private flag.

You're a lifesaver.

On 1/21/2009 12:16:42 PM Matthias Germany wrote:

Matthias

Seeeehr schön, danke!

 +Pingbacks and trackbacks (1)