DEV Community

Tsvetan Gerginov
Tsvetan Gerginov

Posted on

I Got Tired of Downloading Email Attachments One by One, So I Built a Desktop App for It

Picture this: 200 invoices in your inbox, scattered across six months of emails, and accounting needs all of them in a folder. Today. Gmail's UI gives you exactly one way to do this — open email, click attachment, download, repeat. Two hundred times.

I refused. So I built Email Attachment Downloader — an open-source desktop app that bulk-downloads attachments from Gmail and Outlook with filtering, auto-renaming, and a modern dark GUI. Python, MIT licensed, runs on Windows, macOS, and Linux.

What it does

The workflow is simple: connect to your inbox over IMAP, filter, preview, download. But the details are where it earns its keep:

  • Filter by sender, subject, and date rangeinvoices@company.com + "invoice" + Jan–Mar gets you exactly the emails you need, with a built-in calendar picker for dates
  • File type selection — download only PDFs, or only spreadsheets, or images, documents, presentations, archives — your call
  • Preview before download — see every matching email and its attachments, deselect the noise, then pull the trigger
  • Auto-renaming patterns — this is my favorite part. invoice.pdf becomes 2024-01-15_invoice.pdf or john_2024-01-15_invoice.pdf automatically. Anyone who's ended up with invoice.pdf, invoice(1).pdf, invoice(14).pdf knows the pain this solves
  • Threaded downloads — attachments download in parallel without freezing the UI, with a real-time progress bar and activity log

The stack

  • Python 3.10+ with plain IMAP (imaplib) for email access — no Gmail API credentials, no OAuth app registration, no Google Cloud Console. An App Password and you're in
  • CustomTkinter for the GUI — if you think Tkinter apps have to look like Windows 95, CustomTkinter will change your mind. Modern dark theme, clean widgets, zero web stack
  • tkcalendar for the date picker

The architecture is deliberately modular — email_client.py handles IMAP, downloader.py handles extraction and saving, renamer.py is pure renaming logic.

Security — because it's your inbox

An app that asks for your email password deserves scrutiny, so here's the deal:

  • Your password is never stored — it lives in memory for the session only
  • It works with App Passwords (recommended), so your real password never touches the app
  • All connections use SSL/TLS (IMAP over port 993)
  • The app is read-only — it never modifies or deletes emails
  • And it's open source, so you don't have to take my word for any of this — read the code

The README has step-by-step App Password setup guides for both Gmail and Outlook, because that part trips up everyone the first time.

Honest limitations

It searches your INBOX folder over IMAP — if your invoices live in a label/subfolder, or your provider doesn't do IMAP, you're out of scope for now. And it's a desktop tool by design: no cloud, no web version, your credentials and files stay on your machine. I consider that last one a feature, but your mileage may vary.

There's a Windows installer if you just want to use it, or clone and pip install -r requirements.txt if you want to poke at the code. Issues and PRs welcome.

Links:

What's the most attachments you've ever had to download by hand? I'll start: enough to build this app.

Top comments (0)