Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

September 24, 2002 12:00 AM

Setting OWA Mail and Calendar Notifications

Learn how WebDAV Subscribe and Poll methods support OWA
Windows IT Pro
InstantDoc ID #26504
Rating: (0)

Exchange 2000 Server Service Pack 2 (SP2) introduces the ability for Microsoft Internet Explorer (IE) 5.0 and later clients to receive new-email notifications and calendar reminders through Outlook Web Access (OWA). Although Outlook clients typically have a permanent connection to the Exchange server, OWA is a stateless client working over the HTTP protocol. How can the server notify the client that new email has arrived or an appointment is due if the client isn't connected? In this article, I look at how the Web Distributed Authoring and Versioning (WebDAV) protocol's Subscribe and Poll methods support OWA email notifications and calendar reminders. (For more information about WebDAV, go to the WebDAV Resources Web site at http://www.webdav.org.) I use new-email notifications as the primary example, but you implement calendar reminders in a similar way.

Basic Functionality
When you use OWA to connect to your mailbox and browse to your Inbox folder, you're taking a snapshot view of the folder's contents. Consequently, you need to click Check for new messages to refresh and update the Inbox folder's and other folders' contents. This approach isn't ideal because it results in wasteful processing as users continually ask, "I wonder whether I have new email?" and click Check for new messages. New-email notification lets users cease pondering this question and provides the trigger to refresh the Inbox folder.

New-email notifications and calendar reminders are enabled by default. You can modify them by clicking Options in the left-hand pane and changing the E-mail Options settings, as Figure 1 shows. Note that you can choose to display a notification message or play a sound when new email arrives. These settings are persisted as properties on the mailbox, along with other settings such as enabling reminders for calendar items. You can view these properties by using Exchange Explorer (included with the Exchange Software Development Kit—SDK), as Figure 2 shows. The property http://schemas.microsoft.com/exchange/newmailnotify can have a value of 0, 1, 2, or 3 to specify all possible combinations of these settings. The property http://schemas.microsoft.com/exchange/enablereminders controls the calendar reminder operations. Because these settings are held as properties on user mailboxes, you can programmatically change them.

New-email notification and calendar reminders are restricted to IE 5.0 and later clients because they are implemented using Dynamic HTML (DHTML) behaviors. When you get notification that new email has arrived, the bottom-left corner of the main OWA window displays an icon that you click to refresh the display of your Inbox folder. Figure 3 shows how this window looks for an IE 5.0 client. For IE 5.5 and later, you'll also see a pop-up window that originates from the System Tray. In addition, if you're using Folder View, dynamic client-side script automatically updates the unread count for the Inbox.

WebDAV Poll and Subscribe
The client initiates the process of checking for new email notifications or calendar reminders. Upon initialization, the client subscribes to the Inbox folder and requests that the server maintain information about whether new email has arrived. The client then polls the Inbox on a regular basis and, based on the server's response, determines whether new email has arrived since the last poll. Note that the client doesn't read the contents of the Inbox during each poll, nor does it specify to the client which messages are new; it merely asks the server whether some activity has occurred on the folder since the last poll. The response is enough for the client to know that a simple refresh of the Inbox will reveal new messages.

To check for calendar reminders, the client subscribes to the calendar folder, requesting notification if any updates occur. The client also searches the calendar folder for any reminders that are due within the next 2 days and maintains a local XML document that contains details of the relevant items. The property urn:schemas:calendar:remindernexttime on a calendar item contains information about when the next reminder is due. Client-side script refreshes the local XML document, which is maintained in memory, only if a poll determines that an update has occurred or if all items in the XML document have passed their next reminder time.

The key to these client requests is the ability to use the WebDAV protocol against the Exchange Store (and the document store in Microsoft SharePoint Portal Server) to subscribe to a URL and to subsequently poll that subscription for updates. In the case of new email, the URL points to the user's Inbox (e.g., http://dboexcvs1/exchange/kevin.laahs/inbox).

The WebDAV protocol extends HTTP 1.1 with methods that accommodate manipulating resources, collections of resources, and properties. As Figure 4 shows, an HTTP message consists of three parts—the initial line, header lines, and the main body—and the values in these elements will depend on the nature of the HTTP communication. The initial line has three components. On a request from a client, the initial line will contain the method name, the Uniform Resource Identifier (URI), and the client version. On a response from the server, the initial line will contain the server version, the response status code, and the reason phrase. The header lines specify relevant host headers for the task at hand, and the optional body will usually contain an XML-formatted document that's either being sent to or received from the server. Host headers can supply details such as response timeouts and the number of records to return during a search.

If you take a network trace of an OWA client during initialization, you'll see an HTTP message containing the Subscribe method for the user's Inbox. Figure 5 shows the message (I've removed certain lines for clarity).

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.