What’s the Real Size of Exchange Online Mailboxes?

Office 365 Substrate Makes Exchange Online Mailboxes Bigger

Exchange Online assigns 100 GB mailbox quotas to Office 365 accounts with E3 and E5 enterprise plans. It therefore follows that the maximum size of an Exchange Online mailbox is 100 GB? Actually, this is not the case because the quota assigned to a mailbox is only one part of the equation.

Mailboxes Split into IPM and Non-IPM

Exchange Online (and on-premises) mailboxes are divided into two: “Interpersonal messaging” (IPM) and non-IPM. The division between IPM and non-IPM folders has existed since the earliest days of Exchange Server. You can think of these as places where regular email is stored (and usually accessible to clients) and system storage. The root of the IPM part is called “Top of Information Store” while the overall mailbox root is the root container or “\” (a name shared with public folders). Mailbox quota only applies to the folders in the IPM part. A separate quota limits the data that can be stored in the Recoverable Items folders, which appear in the non-IPM part, but no quota applies to other system folders.

The entire mailbox structure is revealed and navigable using a utility like MFCMAPI. Useful as MFCMAPI undoubtedly is to see the content of folders and the properties of individual items, it won’t tell you anything about mailbox size. For that we’ve got to use PowerShell.

Cmdlet Choice

I use the REST version of the Exchange cmdlets in these examples, if only because these cmdlets report mailbox sizes as ByteQuantifiedSize properties while the regular (remote PowerShell) versions return strings. This makes it easier to sort by mailbox size or perform calculations with the size data. It’s easy to switch to the older cmdlets if you prefer.

Reporting Visible Mailbox Size

First, let’s discover the size of the IPM part of the mailbox, or the size charged against mailbox quota. The Get-ExoMailboxStatistics will do the job using a version of a classic one-line command that Exchange administrators have run to report mailboxes since PowerShell was introduced in Exchange 2007. This code fetches all mailboxes and then retrieves mailbox statistics before sorting the outputting the information.

Get-ExoMailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited | Get-ExoMailboxStatistics | Sort TotalItemSize -Descending | Format-Table DisplayName, TotalItemSize, ItemCount

isplayName                   TotalItemSize                  ItemCount
-----------                   -------------                  ---------
Tony Redmond                  3.764 GB (4,042,041,235 bytes)     27009
Jeff Guillet                  2.004 GB (2,152,196,442 bytes)     13150
Global Tenant Administrator   1.071 GB (1,149,444,376 bytes)      7992
Vasil Michev (Technical Guru) 989.1 MB (1,037,162,371 bytes)      6595

Many administrators assume that the value reported by Get-ExoMailboxStatistics is all that matters because it affects the remaining quota. That’s certainly true if all you think about is quota. Let’s probe deeper.

Listing the Hidden Folders

The Get-ExoMailboxStatistics cmdlet only reports IPM content, so we can’t use it to tell us how much storage the Non-IPM folders occupy. However, the Get-ExoMailboxFolderStatistics cmdlet can by using the FolderScope parameter to restrict reporting to “NonIPMRoot.” Only Non-IPM folders are retrieved with this scope.

The Deleted Items folder is an outlier. It is part of the IPM structure, its storage is charged against mailbox quota, and the folder is reported by Get-ExoMailboxFolderStatistics. However, it’s also listed as a non-IPM folder when Get-ExoMailboxStatistics runs with a non-IPM folder scope.

The code below fetches details of all non-IPM folders and extracts the number of items and folders size. The data is stored in a PowerShell generic list object. Because hundreds of non-IPM folders exist (my mailbox has 457), we sort by folder size and select the top 10. Figure 1 lists the top 10 non-IPM folders in my mailbox.

$Folders = Get-ExoMailboxFolderStatistics -Identity [email protected] -FolderScope NonIPMRoot
$Report = [System.Collections.Generic.List[Object]]::new() # Create output file 
ForEach ($Folder in $Folders) {
    $ReportLine = [PSCustomObject] @{
           Folder = $Folder.Name
           Size   = $Folder.FolderSize.Value
           Items  = $Folder.ItemsInFolder } 
    $Report.Add($ReportLine) }
$Report | Sort Size -desc | Select -First 10 | Out-GridView
Non-IPM folders reported by Get-ExoMailboxFolderStatistics
Figure 1: Non-IPM folders reported by Get-ExoMailboxFolderStatistics (image credit: Tony Redmond)

Analyzing the non-IPM folders tells us that Exchange Online, or rather, the Office 365 substrate, stores a huge amount of data in user mailboxes. The IPM part of my mailbox holds 27,009 items and 3.76 GB. The largest non-IPM folder reported in Figure 1 is bigger than the entire IPM part at 29,460 items and 4.05 GB.

Search Folders

To complicate matters, many of the non-IPM folders are MAPI search folders, meaning that they hold links to the real items stored in other folders rather than copies of the items. Exchange generates the link items by resolving search criteria (a property of the search folder) such as “All Attachments” as used by the OWA Files view.

Less storage is needed for a link. For instance, Figure 2 shows the properties of an item in two folders. The top is the real item stored in the Sent Items folder. Its size is 1,745,543 bytes, or 1.66 MB. The bottom is a link to the item in a search folder and its size is 26,495 bytes. The storage reported by Get-ExoMailboxStatistics for search folders is for the real items instead of the links, so this must be taken into account when calculating the real size of a mailbox.

MAPI links and real items
Figure 2: MAPI links and real items (image credit: Tony Redmond)

Reporting Hidden Data

We need to tweak the script to generate a report of the total for non-IPM data in Exchange Online mailboxes. We need to:

  • Collect a set of mailboxes to analyze.
  • Calculate the overall count and storage for non-IPM folders in a mailbox by reading information for the root non-IPM folder. The properties stored for folders and subfolders item counts and size serve this purpose.
  • Fetch information about the top 10 non-IPM folders in each mailbox. Limiting processing to 10 folders speeds things up a lot, and anyway, we’re not too interested in folders that hold a small amount of data.
  • Generate our report.
$Report = [System.Collections.Generic.List[Object]]::new() # Create output file 
$Mbx = Get-ExoMailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited 
ForEach ($M in $Mbx) {
     Write-Host "Processing" $M.DisplayName
     $Folders = Get-ExoMailboxFolderStatistics -Identity $M.UserPrincipalName -FolderScope NonIPMRoot
     # Figure out the overall size of the non-IPM part of the mailbox
     $TotalSize = $Folders[0].FolderAndSubfolderSize.Value
     $TotalItems = $Folders[0].ItemsInFolderAndSubfolders
     # Don't want to report thousands of folders, so select the largest 10 from the mailbox
     $Folders = $Folders | Sort FolderSize -Descending | Select -First 10  
     ForEach ($Folder in $Folders) { #Add records for each folder
        $ReportLine = [PSCustomObject] @{
           Folder   = $Folder.Name
           Size     = $Folder.FolderSize.Value
           Items    = $Folder.ItemsInFolder
           Mailbox  = $M.DisplayName
           Type     = "Folder" } 
        $Report.Add($ReportLine) }
# Add record for the entire mailbox
       $ReportLine = [PSCustomObject] @{
           Folder  = "Mailbox Summary"
           Size    = $TotalSize
           Items   = $TotalItems
           Mailbox = $M.DisplayName
           Type    = "Mailbox" } 
        $Report.Add($ReportLine) }
$Report | ?{$_.Type -eq "Mailbox"}| Select Mailbox, Items, Size | Sort Size -Descending | Out-GridView
Summary Mailbox data for non-IPM folders
Figure 3: Summary of non-IPM folder data in user mailboxes (image credit: Tony Redmond)

Calculating Mailbox Size

Remember, the IPM part of my mailbox holds 27,009 items and 3.76 GB. The Non-IPM data part stores 160,282 items and 19,22 GB, less 1.69 GB for the Deleted Items folder, or 17.53 GB. At first glance, it seems like the Office 365 substrate stores nearly five times as much data in system folders as in those used for regular email. However, because many of the non-IPM folders are search folders, their real size is less than reported.

Factors contributing to the size of an Exchange Online mailbox are:

  1. The size reported by Get-ExoMailboxStatistics. This storage is charged against the mailbox quota and is used for client-accessible folders like Inbox, Sent Items, Calendar, Contacts, and so on.
  2. The size of the Recoverable Items folders (Versions, Deletions, Calendar Logging, Purges, SubstrateHolds, eDiscoveryHolds). This storage is charged against the mailbox recoverable items quota.
  3. The size of system folders in the IPM tree, like Conflicts, Conversation History, LinkedIn (contacts), Recipient Cache, PersonMetadata, and Team Chat. No quota is applied to these folders.
  4. The size of the non-IPM folders, less the Deleted Items folder because that is reported by Get-ExoMailboxStatistics.

It’s difficult to figure out the exact size for an Exchange Online mailbox on disk. Suffice to say that it’s larger than you think, but as Microsoft doesn’t document how it stores application data inside mailboxes, all we can do is test, observe, and speculate. Just like we’ve done here.