Handling Calendar Appointments for IMAP4 Clients

Connecting Internet Client Protocols to Exchange Online

Most people I know who use Office 365 for email use a mixture of Outlook clients (desktop, browser, or mobile). These clients use Microsoft and internet protocols to connect to Exchange Online (MAPI over HTTP, Exchange Web Services, Outlook mobile synchronization), and Microsoft takes care to make sure that clients and server connect together smoothly.

Some prefer not to use a Microsoft client and prefer software based on internet standards, or choose to look for a non-Outlook client because their Office 365 license doesn’t include Office, or they prefer the simplicity of a client that purely concentrates on email. Often, this means looking for a client based on IMAP4 or POP3 for mail access and SMTP to send messages. The basic difference is that IMAP4 stores messages on a server while POP3 downloads them to the client and removes them from the server. POP3 is the older protocol and is now pretty antiquated. IMAP4 also dates back to the early days of the Internet but has been upgraded many times since, so it’s the more preferable protocol if you go down this road.

Exchange Online supports both the IMAP4 and POP3 protocols and the connection settings for Office 365 are available online. Some clients are able to configure settings automatically, while others take a little more effort to make sure that the right ports and encryption are used.

A wide range of IMAP4 and POP3 clients are available, including Thunderbird by Mozilla, which has been around for a long time and supports Windows, Mac, and Linux, and the eM client (for Windows and Mac), my current favorite (Figure 1). Although the protocols might limit some of the functionality available to clients (there’s no trace of the Focused Inbox, for instance), a client like eM is still feature-rich and more than meets the needs of someone who just wants to process some email.

The eM client for Windows connected via IMAP4 to an Exchange Online mailbox
Figure 1: The eM client for Windows connected via IMAP4 to an Exchange Online mailbox

Configuring IMAP4 Access

By default, the mailboxes for new Office 365 accounts are not enabled for IMAP4 or POP3 access. Before an account can connect, an administrator must enable access by editing the mailbox properties through the Exchange Administration Center (Figure 2) or by running the Set-CASMailbox cmdlet. The reason why this cmdlet is used instead of Set-Mailbox is that Exchange moved control of protocol-related settings to a separate cmdlet when the Client Access Server role was introduced in Exchange 2007. That server role is integrated in the main server in modern versions, but the separation between protocol and other mailbox settings still exists.

How to enable an Exchange Online mailbox for IMAP4
Figure 2: How to enable an Exchange Online mailbox for IMAP4

For example, this command enabled the Kim Akers mailbox for IMAP4:

Set-CASMailbox -Identity Kim.Akers -IMAPEnabled $True

When the account is enabled for IMAP4, Exchange sets some default values for the properties that control IMAP4 access, which we can see with the Get-CASMailbox cmdlet:

Get-CASMailbox -Identity Kim.Akers | Format-Table IMAP*

ImapEnabled                             : True
ImapUseProtocolDefaults                 : True
ImapMessagesRetrievalMimeFormat         : BestBodyFormat  
ImapEnableExactRFC822Size               : False
ImapSuppressReadReceipt                 : False
ImapForceICalForCalendarRetrievalOption : False

Handling Calendars

In most cases, these settings don’t need adjustment. However, if you have clients that can handle iCalendar format meeting notifications, you might want to set the ImapForceICalForCalendarRetrievalOption to $True so that clients receive meeting notifications in iCAL format instead of a link that forces them to open OWA to process the request. OWA settings include an option to allow a user to opt for iCalendar (Figure 3 – the options only appear if the mailbox is enabled for POP3 or IMAP4).

Choosing iCalendar for IMAP4 through OWA options
Figure 3: Choosing iCalendar for IMAP4 through OWA options

Some reports in the past say that when this option is taken OWA sets ImapForceICalForCalendarRetrievalOption correctly, it doesn’t updateImapUseProtocolDefaults to $False, which is needed to make the option work correctly. Checking this over the last day or so shows that everything happens as expected.

PowerShell to Set IMAP4 Options

But if you want to be sure that your IMAP4 or POP3 settings are correct, we can handle the situation through PowerShell. One approach is to look for any mailbox enabled for IMAP4 and set the iCalendar option correctly on the basis that most IMAP4 clients use iCAL today. Here’s a quick and dirty script to do the job.

$Mbx = (Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox)
ForEach ($M in $MBX) {
     If ((Get-CASMailbox -Identity $M.Alias).ImapEnabled -eq $True) {
       Write-Host "Processing" $M.DisplayName
       Set-CASMailbox -Identity $M.Alias -ImapUseProtocolDefaults $False -ImapForceICalForCalendarRetrievalOption $True
       Start-Sleep -m 200 }

The code fetches a list of user mailboxes and then steps through each to find IMAP4-enabled mailboxes before setting the right values for the control properties. The same approach can be taken to adjust the properties controlling POP3 access.

It’s a good idea to check how many accounts are enabled for these older protocols and limit access to the accounts that really need to use IMAP4 or POP3 and to make sure that mailbox properties are set as expected when the protocols are enabled. It’s the kind of good housekeeping that an admin should do, if only time was available.

For more information about Exchange Online clients and how to configure settings for POP3 and IMAP4, see Chapter 10 of the Office 365 for IT Pros eBook.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.