Migrate

Migrate MBOX to Office 365: Convert and Upload via IMAP

Move MBOX archives into Office 365 by converting or uploading over IMAP. Covers Thunderbird sources, PST conversion option, and verification.

AK

Alex Kerr

Lead Migration Engineer, Mailbox Taxi

Reviewed by Priya Shah
· 10 min read
Dashboard view representing the Office 365 admin console during MBOX import

MBOX files don't fit Microsoft's first-party tooling neatly. Exchange Online has a PST import service and a supported IMAP migration source, neither of which reads MBOX directly. So an MBOX-to-M365 migration always involves a translation step: convert the MBOX to PST and use the network upload route, or read the MBOX in a tool that can append over IMAP to Exchange Online. Picking the right one comes down to size, source variety, and whether you need server-side processing or a desktop-driven run.

Mbox
Office 365

Skip the manual setup — let Mailbox Taxi handle it

One desktop app, every IMAP provider, zero data leaving your machine.

Two routes, different trade-offs

For an MBOX heading to Exchange Online, you have:

  • MBOX to PST conversion plus network upload — Convert each MBOX to a PST using a desktop converter or by routing through Outlook on Windows. Upload PSTs to Azure Storage via AzCopy. Microsoft's import service does the actual write into Exchange Online server-side. Free, scales well, requires the Mailbox Import Export role.
  • MBOX to Exchange Online over IMAP — A migration client reads MBOX and uploads messages via IMAP APPEND to the Exchange Online mailbox. No intermediate file. Slower for large datasets but skips the conversion step and works well for a small number of mailboxes.

Each route uses Microsoft-supported entry points. Neither is a hack. The choice is about operational fit, not legitimacy.

Prerequisites

Centralise the MBOX files

Find the source files and copy them locally. Sources include:

  • Thunderbird profiles<profile>/Mail/<account>/ with extensionless MBOX files plus .sbd subdirectories for nesting.
  • Apple Mail exports.mbox directories with an mbox file inside.
  • Google Takeout — Single large .mbox per Gmail account with X-Gmail-Labels headers.
  • Old Unix mailservers — Single-file mailboxes from /var/spool/mail/.

Copy to a local SSD working folder. MBOX is line-sensitive and reads from network shares occasionally corrupt during streaming.

Verify integrity

Open each file and confirm:

  • The file starts with a From line (capital F, no colon).
  • New messages are delimited by From at line start.
  • The file ends cleanly, not truncated mid-message.

For Thunderbird sources, compact folders in Thunderbird first with File, Compact Folders. Thunderbird marks deleted messages with X-Mozilla-Status but leaves them in the MBOX until compact. A 5 GB Inbox often contains 2 GB of soft-deleted content that you do not want to migrate.

Compact before export, always

Skipping the Thunderbird compact step is the most common reason migrated mailboxes show twice the expected message count. The deleted messages are right there in the MBOX file because Thunderbird never removed them. The migration tool reads them happily and uploads them. Then users complain about Junk and Trash content reappearing in M365.

Prepare Exchange Online

For the PST route, assign your admin account the Mailbox Import Export role in Exchange admin centre under Permissions. Sign out and back in to refresh role assignments.

For the IMAP route, confirm the target mailbox has modern authentication available and OAuth2 IMAP works against Exchange Online. Basic authentication for IMAP was disabled across Microsoft 365 in 2022; only OAuth flows succeed now. Tools that haven't been updated for OAuth2 IMAP cannot upload to Exchange Online.

Check mailbox quotas. A 10 GB MBOX landing in a mailbox at 95 percent quota fails partway through. Increase quota or route old content to the In-Place Archive.

Route A: MBOX to PST plus network upload

  1. Convert MBOX to PST

    Two practical conversion approaches:

    • Desktop converter — A standalone MBOX-to-PST tool reads each MBOX and produces a PST with the same folder structure. Output one PST per source MBOX, or merge into a single PST.
    • Outlook on Windows as intermediary — Configure Thunderbird and Outlook on the same machine. In Thunderbird, copy the MBOX folders into an offline IMAP-style local folder. In Outlook, drag the folders across. Slow but free.

    After conversion, run scanpst.exe against each PST. Repair any errors before continuing.

  2. Get the Azure SAS URL

    Open the Microsoft Purview compliance portal. Navigate to Data lifecycle management, Microsoft 365, Import. Create a new import job, name it (e.g. mbox-import-may-2026), select Upload your data. Copy the SAS URL and download the AzCopy executable.

    The SAS URL is valid for about 30 days. Treat it as a credential.

  3. Upload PSTs with AzCopy

    On the workstation with the converted PSTs, run AzCopy:

    azcopy copy "C:\PSTStaging\*.pst" "<SAS-URL>" --recursive
    

    At 100 Mbps sustained uplink, expect roughly 35 to 40 GB per hour. AzCopy resumes from checkpoint if the session drops. Use Azure Storage Explorer with the same SAS URL afterwards to confirm every PST is present and matches expected size.

  4. Build the mapping CSV

    Create the mapping with the required columns:

    Workload,FilePath,Name,Mailbox,IsArchive,TargetRootFolder,ContentCodePage,SPFileContainer,SPManifestContainer,SPSiteUrl
    Exchange,,jdoe-archive.pst,jdoe@contoso.com,FALSE,/Imported,,,,
    

    Use /Imported as TargetRootFolder to land content in a dedicated subfolder rather than mixing with live mail. For older content destined for the archive, set IsArchive,TRUE.

  5. Run analysis and submit

    Upload the mapping CSV in the import job. Microsoft analyses it against the Azure container and target mailboxes. Fix any errors (filename mismatch, missing mailbox, role permissions) and re-run analysis until clean. Submit the import.

    A 10 GB PST takes 2 to 6 hours from submission. Multiple PSTs run in parallel.

Route B: MBOX to Exchange Online over IMAP

  1. Confirm OAuth2 IMAP access

    Basic authentication for IMAP is gone in Microsoft 365. Your migration client must support OAuth2 for IMAP. Test with a single message before running a large batch.

    The OAuth2 flow needs an app registration in Azure Active Directory with IMAP.AccessAsUser.All delegated permission and an admin consent grant for the tenant.

  2. Map MBOX files to Exchange folders

    Each MBOX becomes a folder in the destination mailbox. The naming convention:

    • An MBOX named Inbox should map to Inbox (not create a new sibling folder).
    • An MBOX named Sent should map to Sent Items (Exchange's name).
    • Custom folder names create new folders with the same name.

    Watch for Inbox and Sent confusion: tools that don't translate these system folder names end up creating Inbox as a sibling of Inbox (the real one). Set up explicit mappings.

  3. Configure throttling

    Exchange Online's IMAP throttling is more permissive than Gmail's:

    • Roughly 60 concurrent connections per tenant.
    • About 1 GB per hour per mailbox sustained.
    • No hard daily message cap, but quality of service drops under heavy load.

    Set concurrency to 4 to 5 simultaneous folder uploads per mailbox. Higher works but provides diminishing returns and risks Server unavailable responses during tenant-wide throttling events.

  4. Run the upload

    Start the migration. Expect 100 to 150 messages per minute over a healthy link. A 10 GB MBOX with 50,000 messages takes 6 to 10 hours.

    Leave the workstation awake. OAuth tokens refresh silently in well-behaved tools; if your client doesn't refresh, you'll get an OAuth2 token expired failure partway through and need to re-authenticate.

  5. Verify after

    Compare per-folder counts between MBOX sources and destination mailbox folders. Read the tool's log for skipped messages, oversized rejections, and any folder that needed rerun.

What changes during the move

Dates

The MBOX message Date headers are preserved. Exchange Online uses these for sort order. Tools that pass internal date during IMAP APPEND keep chronological order intact.

Folder structure

Top-level folders map cleanly. Nested folders via Thunderbird's .sbd directories also map cleanly if your tool understands the convention. If the tool flattens nested folders, you end up with sibling folders at the root with paths in the name (Clients - Acme - 2024 rather than Clients/Acme/2024).

Read state

Read/unread state is preserved if the MBOX retained it. Thunderbird's X-Mozilla-Status header encodes read state and good tools interpret it. Plain Unix MBOX files often don't have read state and everything appears unread in the destination.

Flags and categories

Flags and Outlook categories do not exist in MBOX. All imported messages arrive with no flags, no categories. Set expectations with users.

Archive mailbox for old content

For MBOX files containing decade-old content that you want to retain but not show in the primary inbox, use the In-Place Archive. Through the PST route, set IsArchive,TRUE in the mapping CSV. Through the IMAP route, ensure your tool can target the archive mailbox (some can, some can't). Users see the archive in Outlook desktop and OWA but it doesn't clutter their primary folder list.

Common failure modes

PST route: Mailbox Import Export role missing

The compliance portal greys out Import. Assign the role in Exchange admin centre under Permissions, sign out completely, sign back in. Allow 15 minutes for propagation.

PST route: Cannot find PST in storage

Mapping CSV filename does not match the Azure blob. Case-sensitive. JDoe.pst and jdoe.pst are different files.

IMAP route: OAuth2 token expired

The migration ran longer than the token lifetime. Good tools refresh silently. If yours doesn't, re-authenticate and resume.

IMAP route: IMAP not enabled for this account

The tenant has IMAP disabled at the tenant level. Admin enables in Exchange admin centre under Mail Flow, Connectors, or per-mailbox via PowerShell with Set-CASMailbox -ImapEnabled $true.

Either route: Message too large for destination

Exchange Online caps individual messages at 150 MB. MBOX files occasionally contain larger messages from old mailservers without size limits. Tool log lists them; extract attachments and re-deliver separately.

Either route: Folder name contains invalid characters

Exchange Online rejects certain characters in folder names that were legal in older mail systems. Rename in the source before upload.

Picking a route

Default to the PST conversion plus network upload route when:

  • Total dataset is over 20 GB.
  • You're moving content for many users in one wave.
  • You want Microsoft to handle the heavy lifting server-side.
  • You're comfortable with the Mailbox Import Export role workflow.

Default to the IMAP route when:

  • Total dataset is under 20 GB.
  • You're moving a small number of mailboxes (one to ten).
  • You want detailed per-message logs.
  • Converting to PST first is awkward (e.g. macOS-only workstation, no Windows licence to run the conversion).

For more on the file formats involved, see the MBOX format glossary entry and the PST, MBOX, and EML migration guide. For overall M365 migration planning, the Office 365 migration guide covers the cutover, staged, and hybrid options. If your destination is Gmail instead, see MBOX to Gmail, and for Outlook desktop, MBOX to Outlook.

Try Mailbox Taxi

Migrate your mailbox the easy way

Join the waitlist for early access and lock in launch pricing.

Related reading

Try Mailbox Taxi

Migrate your mailbox the easy way

Join the waitlist for early access and lock in launch pricing.