Migrate
Migrate EML to Gmail: IMAP Upload for Individual Messages
Import EML files into Gmail or Google Workspace using IMAP append. Covers batch handling, label assignment, throttling, and verification.
Dan Okafor
MSP Practice Lead
EML files turn up in odd corners. Legal discovery exports. Forensic captures. Outlook Express archives from a long-defunct workstation. Drag-exported messages users saved when they thought it was a good idea. Whatever the origin, getting hundreds or thousands of EMLs into Gmail comes down to one thing: an IMAP-aware tool that reads each file, builds an APPEND command, and pushes it to the destination mailbox. There is no Gmail web upload, no Workspace admin console option, no Google Takeout in reverse. IMAP is the only road.
Skip the manual setup — let Mailbox Taxi handle it
One desktop app, every IMAP provider, zero data leaving your machine.
What an EML file actually is
An EML file is one email message stored as a flat text file. The format is RFC 5322 for headers and RFC 2045 onwards for MIME body parts. Open one in a text editor and you see:
From: sender@example.com
To: recipient@example.com
Subject: Test message
Date: Wed, 14 May 2025 10:23:00 +0000
Content-Type: multipart/mixed; boundary="boundary123"
--boundary123
Content-Type: text/plain
...
That's it. Attachments are base64-encoded inside the same file. The format hasn't changed meaningfully in 20+ years. Most mail clients produce EMLs when you drag a message to the desktop.
The implication for migration: every message is independent. There's no shared index, no per-folder container, no metadata file. The folder structure that matters comes from how the EML files are organised on disk. A directory called Clients/Acme/2024/ containing 200 EMLs is the entire structure; the tool's job is to recreate that as a Gmail label.
Prerequisites
Gather the EML files
Find the source. Common scenarios:
- Outlook Express or Windows Mail exports — Typically
.emlfiles in a directory tree underDocuments\Outlook Express\or similar. - Apple Mail drag-exports —
.emlor.emlxfiles saved to desktop or a folder. - Forensic captures — Often hundreds or thousands of EMLs in a flat or nested directory.
- Legal discovery exports — Numbered EMLs with naming conventions like
MSG-00001.eml.
Copy everything to a local SSD working folder. Network shares slow the upload dramatically and risk file-locking issues when the tool tries to read many files in parallel.
Organise into intended label structure
This is the planning step most people skip. The directory structure determines the destination labels.
If your EMLs are in a flat folder, they all land under one label (or one big inbox, depending on tool defaults). If you want nested labels in Gmail, organise the EMLs into a matching directory tree before starting.
Example: for Gmail labels Clients/Acme/2024, Clients/Acme/2023, and Personal/Family, organise on disk as:
EmlImport/
Clients/
Acme/
2024/
msg-00001.eml
msg-00002.eml
...
2023/
...
Personal/
Family/
...
The tool maps each directory to a label using slash separators. Get the structure right on disk before you run anything.
Verify integrity
Spot-check EML files. Open a sample in a text editor and confirm:
- Standard headers are present (
From:,To:,Subject:,Date:). - The
Content-Type:header is correct. - The file ends cleanly (no truncation mid-MIME-part).
A corrupt EML usually shows as either an empty body or a binary-looking mess after the header. Tool logs will flag these; you can extract or repair manually before re-running.
EMLX is not EML
Apple Mail produces .emlx files, not .eml. The format is similar but starts with a length-prefix line and ends with metadata that strict EML readers reject. Many tools handle both formats, but some require explicit configuration or a conversion step. Test with one EMLX file before running a batch.
Prepare Gmail
Enable IMAP in Gmail settings: See all settings > Forwarding and POP/IMAP > IMAP Access > Enable IMAP.
For Workspace tenants, the admin also enables IMAP under Apps > Google Workspace > Gmail > End User Access.
Generate an app password for 2-Step Verification accounts: Manage your Google Account > Security > App passwords. For Workspace tenants with app passwords disabled, use a tool that supports Workspace OAuth.
Check quota headroom. A 5 GB EML batch landing in an account at 95 percent quota fails partway through. Expand quota before starting.
Upload the messages
Stage the EML files
Copy everything into a single working folder with the intended label structure as the directory tree. Confirm the directory layout matches what you want in Gmail labels.
Note: total file count and total size. A typical batch of 10,000 EMLs averages 50 KB per file, totalling around 500 MB. Forensic batches with attachments average higher.
Choose an upload tool
Practical options:
- Dedicated migration client — Reads EML directory trees and uploads to Gmail over IMAP with proper throttling. Best for batches over 1,000 files.
- Thunderbird-mediated upload — Drag EML files into a Thunderbird Local Folder, then drag into a connected Gmail IMAP account. Slow but free, fine for small batches.
- Scripting with
imaplibor similar — Roll your own. Only practical if you're already comfortable with the Python email and IMAP libraries.
For most jobs over 1,000 messages, a dedicated client wins. The drag-and-drop approach with Thunderbird becomes painful at scale.
Map directories to labels
Most tools auto-map directory paths to Gmail labels using slash separators. Confirm the mapping in the tool's UI before starting.
Watch for:
- A top-level directory wrapping everything (
EmlImport/). You usually want to skip this and start labels from the next level down. - Empty directories. Some tools create empty labels for them; others skip cleanly.
- Special characters in directory names. Slashes, emoji, and certain Unicode characters can break IMAP folder creation.
- A top-level directory wrapping everything (
Configure throttling
Gmail caps IMAP append at about 750 MB per hour per account and 2,500 messages per day before rate-limiting. For EML uploads, message-count cap usually hits first because each EML is one IMAP APPEND.
Set concurrency to 2 to 3 simultaneous appends. Higher triggers
Too many simultaneous connectionsand degrades throughput.For batches over 2,500 messages, plan to run across multiple days, or accept that Gmail will throttle you partway through and the tool needs to back off and resume.
Run the upload
Start during low-traffic. Expect:
- 80 to 120 EMLs per minute on a healthy link.
- A 10,000-EML batch at average size: 90 to 140 minutes pure transfer time, plus throttle delays.
- Throttle pauses kick in around 1,500 to 2,000 messages.
Leave the workstation awake. Resumable tools recover from drops and continue from the last successful file.
Verify after the run
Compare file counts against destination label counts. Most decent tools produce a per-directory log; read it. Re-run any directory that came up short.
Spot-check messages in Gmail: open a few, confirm headers look right, confirm attachments download. If something looks wrong, the tool log should explain.
What changes during the upload
Dates
Gmail's IMAP APPEND command takes an optional internal date argument. Tools that pass the EML's Date header here keep messages in original chronological order. Tools that omit it timestamp every message with the upload time.
Verify by opening Gmail after the upload and checking that old messages appear in their original position, not at the top of the inbox.
Labels and folder mapping
Each source directory becomes a Gmail label. The IMAP layer interprets slash separators as nested labels. A directory Projects/2024/Q3 lands as nested label Projects/2024/Q3.
If your tool prefixes everything with an import folder name like Imported/, the labels become Imported/Projects/2024/Q3. Some users prefer this for separation; others want labels to land at the top level. Configure before starting.
Read state and flags
EML files don't carry read/unread state. Every message arrives as unread by default. Tools with header-aware mapping can interpret X-Mozilla-Status or X-Gmail-Labels headers (when present) to restore read state, but most plain EMLs from forensic exports or drag-exports won't have those headers.
Stars, important markings, and other Gmail-native flags are not in EML and don't get restored unless the EMLs came from a Google Takeout export (which embeds X-Gmail-Labels headers preserving the original state).
Date header sanity check
Before running a large EML batch, open three or four random files in a text editor and confirm the Date header is present, well-formatted, and not blank. Forensic exports sometimes have stripped or zeroed Date headers. Without a valid date, the IMAP APPEND falls back to the upload timestamp and chronological order is destroyed. Catching this on three files saves you from re-uploading 10,000.
Common failure modes
AUTHENTICATIONFAILED
Gmail credential wrong, IMAP disabled, or app password revoked. Confirm IMAP is on, regenerate app password, use the full email address as username.
Too many simultaneous connections
Concurrency too high. Drop to 2 or 3.
Maximum messages per day reached
Hit Gmail's daily append cap (around 2,500). Pause for 24 hours, resume.
Message too large for destination
Gmail caps individual messages at 25 MB for IMAP append. Larger EMLs are skipped. Tool log lists them; extract attachments and re-deliver separately.
Folder UTF-7 conversion error
A directory name contains characters that fail IMAP's modified UTF-7 encoding. Usually emoji or unusual punctuation. Rename the directory before uploading.
EMLX files rejected as malformed
Apple Mail's EMLX format includes leading length-prefix and trailing metadata. Tools expecting strict EML fail. Either use a tool that handles EMLX, or pre-process to strip the EMLX-specific bytes (the actual EML is between the first newline and the closing metadata).
When to handle EMLs differently
EML upload over IMAP is straightforward when:
- You have under 50,000 files.
- The directory structure represents your intended label hierarchy.
- The destination is a single Gmail account.
When EMLs come from a forensic source with thousands of files in flat directories, consider grouping into MBOX first. A tool that concatenates EMLs into MBOX (one MBOX per logical folder) produces a more compact archive that's faster to upload. See MBOX to Gmail for the upload mechanics.
For background on the EML format, see the EML format glossary entry. For the broader file-import landscape covering PST, MBOX, and EML, see the PST, MBOX, and EML migration guide. For IMAP protocol details that affect throttling and APPEND behaviour, the IMAP protocol glossary entry is the reference. If your destination is Outlook desktop rather than Gmail, see EML to Outlook.
Migrate your mailbox the easy way
Join the waitlist for early access and lock in launch pricing.
Related reading
migrate
Migrate EML to Outlook: Drag and Drop or PST Conversion
Import EML files into Outlook desktop via drag and drop or PST conversion. Covers batch handling, folder mapping, and verification steps.
glossary
What Is the EML Format? A Plain-English Reference
What is an EML file? A practical explainer of the EML single-message format, how it's used in migrations, and how to bulk-import EMLs without losing data.
blog
PST, MBOX, and EML File Migration Guide
How to plan a PST MBOX EML migration: format differences, size limits, corruption recovery, and clean import paths into Gmail, Microsoft 365, and Outlook.
migrate
Migrate MBOX to Gmail: IMAP Append Process Explained
Migrate MBOX archives into Gmail or Google Workspace using IMAP append. Covers Thunderbird sources, label mapping, throttling, and verification.
glossary
What Is IMAP? A Plain-English Definition
IMAP (Internet Message Access Protocol) is the standard that lets email clients read mail from a server. Here's what it does, how it differs from POP3, and why it matters for migrations.
Migrate your mailbox the easy way
Join the waitlist for early access and lock in launch pricing.