Quick answer
- Free way: import your MBOX file into Thunderbird with ImportExportTools NG, then extract attachments from MBOX files with AttachmentExtractor Continued.
- Script way: a short Python script extracts attachments from MBOX files and saves every named one into one folder.
- Bulk way: desktop MBOX attachment extractor software loads MBOX files directly, filters by date, sender or size and saves originals in one pass.
MBOX files keep 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 extract attachments from MBOX files, with real steps, a working script and fixes for missing files.
Do MBOX files hold 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 read every message and decode attachments back into original files.
When you extract attachments from MBOX files, you keep 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 loads 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.
- Open Thunderbird, select your menu icon and choose Add-ons and Themes.
- Search for ImportExportTools NG and AttachmentExtractor Continued. Select Add to Thunderbird for both, then select Add.
- Right-click Local Folders, hover over ImportExportTools NG and then Import mbox Files. Select Individual mbox Files.
- Browse to your MBOX file, select it and choose Open. Your messages appear under Local Folders.
- Right-click your imported folder and select Extract All Attachments to, then choose Browse.
- Select a destination folder to save every attachment from your MBOX files.
You keep your MBOX file where it is, since Thunderbird copies messages into Local Folders. HKU SPACE IT support lists that menu path. If a folder holds 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 extract attachments from MBOX files with Python?
A short Python script can extract attachments from MBOX files 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.
- Install Python 3 on your PC and save script below as
extract.py. - Open Command Prompt in your script folder.
- Run
python extract.py mail.mbox attachments, replacingmail.mboxwith your file name. - Open your new
attachmentsfolder 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 skips parts without a file name, so some inline pictures stay behind. It also keeps 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.
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 cover date, sender, receiver, subject, file name and file size. Free demo extracts 10 attachments per folder.
Steps to extract attachments from MBOX files with software
- Install Corbett Email Attachment Extractor on your Windows PC and run it as administrator.
- Select Open, then Email Data Files and MBOX Files.
- Choose a mode. Choose Files loads one MBOX file and Choose Folders loads a batch.
- Preview your messages. Folder tick boxes start ticked, so untick folders you do not need.
- Select Extract, then Attachments.
- Set date, sender, subject, file name or file size filters if you need fewer files.
- Browse to a destination folder and select Save. Your MBOX attachments land in a new folder that follows your mail folder layout.
Run 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 runs on Windows 10, 8 and 7, needs 100 MB of disk space and keeps no email body text. To pull addresses out of MBOX files too, see how to extract email addresses from MBOX files.
Which way to extract attachments from MBOX files is best?
Use Thunderbird to extract attachments from small MBOX files and Python if you like scripts. Use software to extract attachments from MBOX files when you need filters, big batches or inline files.
| Way to extract MBOX attachments | Cost | Filters | Needs | Best for |
|---|---|---|---|---|
| Thunderbird with two add-ons | Free | Select messages only | Thunderbird, add-on support | One small file |
| Python script | Free | None | Python 3 | Quick bulk save |
| Corbett Email Attachment Extractor | Free demo, then from $99 | Date, sender, subject, name, size | Windows PC | Big batches |
Why are MBOX attachments missing after extraction?
Missing MBOX attachments come from three causes when you extract attachments from MBOX files. Inline pictures carry no file name, so scripts and some add-ons skip them. Your add-on can lack support for your Thunderbird version. A very large MBOX file may need time to load 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 keeps 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 read 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 fast but skips inline pictures. Software fits big archives and filters.
Key takeaways
- MBOX attachments sit as encoded text inside messages, so a tool must decode them.
- Thunderbird needs ImportExportTools NG to load MBOX files and an attachment add-on to save files.
- A Python script saves named attachments free, but it skips unnamed inline pictures.
- Corbett Email Attachment Extractor filters by date, sender, subject, file name and size. Free demo extracts 10 attachments per folder.
- Scan extracted MBOX attachments with antivirus software before you open them.
Questions about extracting attachments from MBOX files
How do I extract attachments from MBOX files?
Import your MBOX file into Thunderbird and use an attachment add-on, run a Python script or load your file in software that saves attachments in bulk.
Do MBOX files include attachments?
Yes. MBOX stores messages and attachments together in one text file, with attachments encoded inside messages.
Can I extract attachments from MBOX files for free?
Yes. Thunderbird with two add-ons or a Python script extracts attachments from MBOX files free. Software adds filters and batch loading.
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.
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.
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.
Does Corbett software extract inline MBOX attachments?
Yes. Corbett's page says inline attachments in message bodies come out along with ordinary files.
How many attachments does free demo extract?
Free demo extracts 10 attachments per folder. Full edition lifts that cap.
Which Windows versions does software need?
Corbett's page lists Windows 10, 8 and 7. There is no Mac or Linux build.