Apple Mail deletes messages from Exchange hosted mailbox


Recently I came across a minor disaster: one of our customers was missing thousands of emails from his “Deleted Items” folder on an Exchange hosted mailbox. Apparently there are personalities that interpret the Inbox as all-that-is-needed location, and Deleted Items as all-that-has-to-be-archived pot. In such case you will need as a sysadmin reasonable retention policy and loads of archive storage.

Since the customer in question is simultaneously using Outlook, iPhone, iPad, Apple Mail and OWA it took a while to locate the cause of the problems first, but after a while (with the help of the IIS log files that reported /ews/exchange.asmx SoapAction=DeleteItem; from this account) the problem could be narrowed down to the Mail application of the renown Mac OS X.

How to set Mac Mail to not hard-delete messages from the Deleted Items folder on Exchange

Initially when a new mailbox account to an Exchange hosted mailbox is created there are two relevant options that a Mac Mail user can select from: the Exchange 2007 and Exchange IMAP, the latter making sense only if IMAP service is started and the user has an enabled IMAP access, the former utilizing EWS (Exchange Web Services) running on top of the SOAP protocol (for additional information see the Links paragraph below).

There is a fine difference between the two account types in respect of messages deletion. To access the options, start Mac Mail, go to Mail / Preferences / Accounts and there select Mailbox Behaviors. In the “Exchange 2007” account under the Trash section you have only “Store deleted messages on the server”, whereas by “Exchange IMAP” you see additionally “Move deleted messages to the Trash mailbox”, as depicted below.

This is where IMAP has an additional step to control: Back in the mail viewer window, look for your list of folders. If you don’t see it, from the View menu select View Mailbox List or View Mailboxes. Click the folder you want to use as a deleted messages folder. From the Mailbox menu, select Use This Mailbox For or Use Selected Mailbox For and then choose Trash.

In contrast the “Exchange 2007”-type configured account is missing this option, but is correctly recognizing the Deleted Items folder and translating it into Apple’s “Trash” parlance.

In both cases the default option under “Permanently erase deleted messages when:”-setting is set to “One month old”. This is where the above described problem comes from. “Permanently erase” means hard-delete for Exchange, but this operation, when performed from Mac Mail is not compliant with the Deleted Item Recovery (DIR, respectively DIR 2.0 under Exchange 2010) functionality, thus the emails are being ultimately erased and are not available via “Recover Deleted Items…” function under MAPI clients or OWA. Additionally when a MAPI client is hard-deleting an item as a part of its Autoarchive schedule, this item is copied to the archive.pst file, consequently satisfying two rules: to decrease the size of an online mailbox and to keep an archived correspondence – in this case on a local workstation. As mentioned above for a MAPI client, hard-deleting is made DIR-compliant and the item is tombstoned for a certain amount of time dependent on the Deletion Settings, found under the Database Properties / Limits tab on EMC. Neither of these compliances are satisfied when using Mac Mail, so in general I recommend against its deployment in a productive environment, but in our particular scenario we needed some sort of workaround, which was as easy as to set the “Permanently erase deleted messages” to “Never” as depicted below, and leave the compliant work for some more advanced email clients.


With this selected option you are only protecting the Deleted Items folder, respectively the soft-deleted items that land there. If you hard-delete an email using Option+Delete from a Mac Mail there is no way to bring this message back except through a database recovery workflow.



Recover Deleted Items for Mac users on Microsoft Exchange Server:

In Mac OS X, how do I get the Mail application to remove messages I delete:

Where are my deleted items going in Mac Mail:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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