Subscribe to Windows IT Pro
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)

The Notification-Type header specifies that this subscription request is for any new email that arrives at the URL passed in the initial line. Other notification types can determine whether items have been updated, deleted, or moved at the URL specified. SharePoint client extensions to Web Folders and calendar reminders, which subscribe to receive Update notification types, often use these notification types.

In response to the Subscribe request, the server returns an HTTP message formatted as Figure 6 shows (I removed some lines for clarity). The server allocates a unique ID to each successful subscribe request and returns the ID in the Subscription-id header. The client essentially leases the subscription; if the client doesn't resubscribe within the lease period, the server cancels the subscription when the lifetime has passed. Figure 6 shows a lifetime of 1 hour (3600 seconds). This leasing mechanism avoids the server having to process subscriptions for clients that don't unsubscribe cleanly (for example, if a user switches off his or her PC or closes the browser without logging off). The Subscribe request can specify the desired lifetime, but the OWA client doesn't use the desired lifetime parameter. All subscriptions default to the 1-hour lifetime, as do calendar reminder update subscriptions.

After a client establishes a successful subscription, a Poll method can determine whether any notifications are available. Figure 7 shows the relevant parts of the HTTP message that the OWA client sent. The client initiates polling the Subscription-id at regular intervals—every 2 minutes for new email notifications and every 15 minutes for calendar reminders. These timings are set as the pollinterval attribute on the notification and reminder behavior elements that are hidden on the server-generated navigation bar Web page. The behavior definitions are in the Ctrl_notify20.htc, Ctrl_reminder20 .htc, and Ctrl_poll20.js files in the \exchweb directory on the server. You can use the registry to change the default polling time on the Exchange 2000 server, but implementing user-specific timing requires changes to these files. Figure 8 shows the registry entry for new email notifications. Figure 9 shows the registry entry for new calendar reminders.

The SP2 deployment guide (http://www.microsoft.com/exchange/techinfo/deployment/2000/sp2deployment.asp) states that each client poll takes 0.064 megacycles on a server running Exchange 2000. Therefore, a system with an eight-processor, 550MHz server and 3000 users generates the following CPU load (assuming all clients poll simultaneously): A 1-minute poll generates a 7.2 percent CPU load, a 2-minute poll generates a 3 percent CPU load, and a 5-minute poll generates a 1.4 percent CPU load. Note that the Default reminder time for calendar items, which you can specify in the Options dialog that Figure 1 shows, isn't related to the reminder polling interval. The reminder polling interval is the default used to calculate reminder times for new appointments (and is stored in the http://schemas.microsoft.com/exchange/reminderinterval property on the user's mailbox).

Upon a successful poll, the server will send an HTTP response message. From the message status and XML body, the client can determine whether new email has been delivered. Figure 10 shows two examples of HTTP response messages (with some lines removed for clarity). Both responses are multistatus responses because, in theory, a single Poll request can ask for the status of multiple subscription IDs. Therefore, you need to look at the XML body to see the status of the individual IDs. In the first example, you can see that the status specifies that No Content was found, whereas in the second example you see 200, specifying that new email has been delivered. The client then displays the new-email icon. When the user clicks the icon, it issues a URL to the contents of the user's Inbox (e.g., http://dboexcvs1/exchange/kevin.laahs/inbox?cmd=contents).

When the client chooses to have sound play with notifications, the sound comes from the file Exchweb/img/notify.wav held on the server (the calendar reminder comes from reminder.wav). As with setting the poll interval, setting a user-specific sound requires customization of the dynamic behavior. In addition, the client will use the PROPFIND method to read the value of the property urn:schemas:httpmail:unreadcount on the user's mailbox and display this value alongside the Inbox folder. The ability to display the unread count of both mailbox and public folders is another new feature in SP2. The only other status value that the client acts upon is labeled 412 (Precondition failed), which indicates that the subscription has expired. In this case, the client executes a new Subscribe request.

Microsoft has provided support for Poll and Subscribe methods in the Exchange Store since Exchange 2000's first release. But the OWA client didn't take advantage of these methods until Microsoft released SP2. Instant Messaging (IM) uses the Poll and Subscribe methods in SP1 for client-instantiated communications, and SharePoint Portal Server Client Extensions use the methods against the Document Store for Web Folders functionality. You can also use these powerful methods in your own applications that work with data in the Exchange Store or Document Store.

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

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