Downloading batch emails' attachments

10 Jun 2025

I 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:

  1. Download Python and Thunderbird
  2. Install eml-extractor 0.1.1 https://pypi.org/project/eml-extractor/
pip install eml-extractor
  1. Add python/scripts to your path so you’ll be able to use eml-extractor as a command
  2. 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
  3. 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.