Downloading batch emails' attachments
10 Jun 2025I needed to do some backups and wanted to download a lot of email attachments spanning several emails through several years. Obviously I don’t want to do that manually. This is the solution I found:
- Download Python and Thunderbird
- Install eml-extractor 0.1.1 https://pypi.org/project/eml-extractor/
pip install eml-extractor
- Add python/scripts to your path so you’ll be able to use eml-extractor as a command
- In Thunderbird, connect your email account, select the emails that have the attachments you want and download them using “Save as” to get emails and their attachments in .eml format
- Run eml-extractor on the folder containing the .eml files
eml-extractor --source "/home/user/Downloads/emails" --destination "/home/user/Downloads/emails_extracted"
This will extract all attachments from all emails in the folder and save them in the attachments folder.