Extract Attachments from MBOX Files

Save MBOX attachments. Thunderbird add-ons, a Python script and a Windows tool with real steps.

By · Published 7 Jan 2025 · Updated 10 Oct 2026 · 8 min read

Extract attachments from MBOX file

Quick Answer

Extract attachments from MBOX files in 3 ways. Use add-ons, a Python script or MBOX attachment extractor software.

Add-ons suit a few files and need Thunderbird. Script suits one folder of named files. Software opens MBOX files and filters by date or size.

Test one MBOX file before you do the rest.

MBOX files retain every message and its attachments as one text file so you cannot open it and grab your PDFs. Windows has no built-in way to save MBOX attachments and saving them one by one from a mail app takes hours. Below are three ways to save MBOX attachments, with real steps, a working script and fixes for missing files.

Do MBOX files contain attachments?

Yes. MBOX files store messages in plain text, one after another and attachments sit inside messages as encoded text. Thunderbird, Apple Mail and Eudora use that format and Google Takeout exports Gmail as MBOX. To extract attachments from MBOX files, a tool must open every message and decode attachments back into original files.

When you save MBOX attachments, you retain backup copies of your files. Large MBOX files with big attachments are harder to open and move around.

How to extract attachments from MBOX files in Thunderbird?

Thunderbird can extract MBOX attachments with two free add-ons. ImportExportTools NG opens your MBOX file into Local Folders. AttachmentExtractor Continued then saves attachments from selected messages. Add-on pages list supported Thunderbird versions so check yours before you install.

  1. Open Thunderbird, select your menu icon and choose Add-ons and Themes.
  2. Search for ImportExportTools NG and AttachmentExtractor Continued. Select Add to Thunderbird for both, then select Add.
  3. Right-click Local Folders, hover over ImportExportTools NG and then Import mbox Files. Select Individual mbox Files.
  4. Browse to your MBOX file, select it and choose Open. Your messages appear under Local Folders.
  5. Right-click your imported folder and select Extract All Attachments to, then choose Browse.
  6. Select a destination folder to save every attachment from your MBOX files.
Thunderbird folder menu with the Extract All Attachments to option for MBOX attachments

You retain your MBOX file where it is, since Thunderbird copies messages into Local Folders. HKU SPACE IT support lists that menu path. If a folder contain thousands of messages, give Thunderbird a few minutes to finish before you extract. One Thunderbird user on Mozilla Support wanted every attachment in one place and found that saving by hand asked for a folder every time and prompted on duplicate names. A helper suggested Filtaquilla add-on and that user said it worked "in a way" but not perfectly. To save attachments from a live Thunderbird mailbox, see how to Download attachments from Thunderbird.

How to save MBOX attachments with Python?

A short Python script can save MBOX attachments without any mail app. It uses Python's built-in mailbox module so you install nothing extra. It saves every part that carries a file name and renames duplicates as name(1).ext.

  1. Install Python 3 on your PC and save script below as extract.py.
  2. Open Command Prompt in your script folder.
  3. Enter python extract.py mail.mbox attachments, replacing mail.mbox with your file name.
  4. Open your new attachments folder and check your MBOX attachments.
import mailbox, os, re, sys
src, out = sys.argv[1], sys.argv[2]
os.makedirs(out, exist_ok=True)
count = 0
for msg in mailbox.mbox(src):
    for part in msg.walk():
        name = part.get_filename()
        if not name:
            continue
        data = part.get_payload(decode=True)
        if data is None:
            continue
        name = re.sub(r'[\\/:*?"<>|]', '_', name)
        path = os.path.join(out, name)
        base, ext = os.path.splitext(name)
        n = 1
        while os.path.exists(path):
            path = os.path.join(out, f"{base}({n}){ext}")
            n += 1
        with open(path, 'wb') as f:
            f.write(data)
        count += 1
print(count, "attachments saved to", out)

That script ignores parts without a file name so some inline pictures remain behind. It also retains no message dates or folder names and it cannot filter by sender. Scan extracted MBOX attachments with antivirus software before you open them. Python's mailbox docs describe that module in full.

Bulk method with free demo

How to extract MBOX attachments in bulk with software?

Use Corbett Email Attachment Extractor to save attachments from MBOX files without Thunderbird. Its page says it saves files in their original format with no data loss, takes inline attachments and renames duplicate names as File(1). Filters include date, sender, receiver, subject, file name and file size. Free demo extracts 10 attachments per folder.

Download Now Purchase Now

Steps to save MBOX attachments with software

  1. Install Corbett Email Attachment Extractor on your Windows PC and open it with Run as administrator.
  2. Select Open, then Email Data Files and MBOX Files.
  3. Choose a mode. Choose Files opens one MBOX file and Choose Folders opens a batch.
  4. Preview your messages. Folder tick boxes start ticked so untick folders you do not need.
  5. Select Extract, then Attachments.
  6. Set date, sender, subject, file name or file size filters if you need fewer files.
  7. Browse to a destination folder and select Save. Your MBOX attachments go to a new folder that follows your mail folder layout.
Corbett Email Attachment Extractor screenshot 1: open the software Corbett Email Attachment Extractor screenshot 2: preview the mailbox Corbett Email Attachment Extractor screenshot 3: start the transfer

Test a demo on one MBOX file first, check your extracted MBOX attachments and then buy. Lifetime licence starts at $99 with a 30-day money-back window. It works on Windows 10, 8 and 7, needs 100 MB of disk space and retains no email body text. To pull addresses out of MBOX files too, see how to Extract email addresses from MBOX files.

Which way to save MBOX attachments suits you?

Use Thunderbird to extract attachments from small MBOX files and Python if you like scripts. Use software to save MBOX attachments when you need filters, big batches or inline files.

Way to extract MBOX attachmentsCostFiltersNeedsSuits
Thunderbird with two add-onsFreeSelect messages onlyThunderbird, add-on supportOne small file
Python scriptFreeNonePython 3Bulk save
Corbett Email Attachment ExtractorFree demo, then from $99Date, sender, subject, name, sizeWindows PCBig batches

Why are MBOX attachments missing after extraction?

Missing MBOX attachments come from three causes when you save MBOX attachments. Inline pictures carry no file name so scripts and some add-ons ignore them. Your add-on can miss support for your Thunderbird version. A large MBOX file may need time to open before extraction starts. Check add-on versions first, then try software that lists inline attachments in its output.

Other mail formats follow a similar pattern. See how to Extract attachments from EML files and how to Extract attachments from a PST file.

Where do you get MBOX files?

Google Takeout exports Gmail as MBOX. Thunderbird retains mail in MBOX-style files in your profile folder and Apple Mail exports mailboxes in it. To create MBOX files first, see how to Export Gmail emails to MBOX or Export MBOX from Thunderbird. To open files before you extract, see how to Open MBOX files.

Our view

Thunderbird add-ons need a version check before install. Python is free and quick but ignores inline pictures. Software fits big archives and filters.

Key takeaways

Questions About MBOX Attachments

Do MBOX files include attachments?

Yes. MBOX stores messages and attachments together in one text file, with attachments encoded inside messages.

Which Thunderbird add-ons extract MBOX attachments?

ImportExportTools NG imports your MBOX file and AttachmentExtractor Continued saves attachments from selected messages.

Do I need Python to extract MBOX attachments?

No. Python is one free way. Thunderbird add-ons and Corbett Email Attachment Extractor work without it.

What happens when two attachments share a name?

Corbett's software renames a second file as File(1). Python above renames it as name(1).ext so no file is overwritten.

How do I extract attachments from MBOX files?

Import your MBOX file into Thunderbird and use an attachment add-on, use a Python script or open your file in software that saves attachments in bulk.

Can I save MBOX attachments for free?

Yes. Thunderbird with two add-ons or a Python script saves MBOX attachments free. Software adds filters and batch loading.

Can I save only PDF attachments from MBOX files?

Corbett's page lists a file name filter so test it on demo. Thunderbird add-ons and Python save every named attachment.

Free demo

Need to Save MBOX attachments?

Try Corbett Email Attachment Extractor to save MBOX attachments, starting with one file. Free demo extracts 10 attachments per folder, then purchase when your files look right.

Download Now Purchase Now

Jared Young

Jared is an engineering graduate in Computer Science who specializes in data recovery and backup. He saves Corbett Software guides on email attachments, backups and mail migration.

Last checked 10 Oct 2026 against Mozilla Support, Python docs and Corbett's attachment extractor page.