// free agents / attachment-saver

📎 Email attachment saver

“Save every email attachment (invoices, PDFs, screenshots) into neat folders automatically.”

Free, no sign-up. MIT licence. Python standard library only, so there's nothing to pip install.

What it does

Scans your inbox over IMAP for emails with attachments and saves them as month/sender/filename. Filter by file type and sender, and duplicates are skipped by hash. Point it at a Google Drive, Dropbox or OneDrive synced folder and they end up in the cloud.

What you need

5-minute setup

Python

  1. Install Python 3.9+ and unzip the download.
  2. Try it with no accounts: python3 attachment_saver.py --eml-dir sample_emails --dry-run
  3. Copy .env.example to .env and fill it in.
  4. Run: set -a; . ./.env; set +a; python3 attachment_saver.py (Windows steps in the README).

n8n (no code)

  1. Workflows, then Import from file, then attachment-saver.n8n.json.
  2. Follow the yellow “Read me” note (credentials or webhook).
  3. Test workflow, then switch it to Active.

Run it on a schedule

Every hour with cron:

0 * * * * cd /path/to/attachment-saver && set -a && . ./.env && set +a && python3 attachment_saver.py >> run.log 2>&1

On Windows use Task Scheduler. With n8n, the Schedule node does it for you.

Settings

VariableWhat it does
IMAP_HOST / IMAP_USER / IMAP_PASSWORDYour mailbox
SAVE_DIRWhere to save, default ./saved_attachments
EXTENSIONSDefault pdf,png,jpg,jpeg,docx,xlsx,csv,zip
FROM_CONTAINSOptional sender filter, e.g. invoice,billing@,amazon
DAYSHow far back to look, default 7

What we tested

Honest limits

Want one built for your task?

Describe it in one sentence. We build it, test it and hand it over, usually within 24h.

Join the waitlist →