spam-digest reads the spam folders of your IMAP mailboxes, lets AI sort each email into probably legitimate, uncertain or spam, and sends you a digest you can act on from a web page: rescue it, trust the sender, or delete it.
A small, focused tool: one email a day tells you what landed in spam, and a couple of clicks fix the mistakes.
On your schedule, one HTML email per mailbox lists what is in the spam folder: sender, subject, date. No email when the folder is empty, unless you ask for it.
Anthropic Claude labels each email probably legitimate, uncertain or spam with a short reason. Only the sender and subject are sent, never the body.
A review page linked from the digest moves an email to INBOX, optionally trusting the sender, or deletes it. Bulk buttons handle a whole section at once.
Rules by sender, domain or subject keyword. Blocked emails are deleted at the next run, allowed ones moved to INBOX, and both are listed in the digest for transparency.
Delete everything the AI confirmed as spam with one button, after a confirmation page, so link scanners in your mail system can't delete anything on their own.
Web actions use HMAC-signed links that rotate with every digest. They only act on the emails listed in the last run, never on anything else in the mailbox.
Watch any number of IMAP accounts from one container, each with its own spam folder and digest recipient. Common folder names are detected automatically.
Schedule, configuration and last-run results per mailbox, with buttons to run a digest now for one mailbox or all of them.
Pure Python standard library in a small Docker image on Docker Hub and GHCR. Digest delivery via SMTP or Resend.
All screenshots use placeholder data (contoso.com, example.com).
Digest email. Emails grouped by AI label with the reason, what your rules already handled, and buttons to review or delete. (Scroll inside the image.)
Review page. Trust and move to INBOX, move without trusting, or delete, one email at a time or a whole section.
Dashboard. Schedule, configuration and the last run of every mailbox, with Run buttons.
Filters page. Blocklist and allowlist rules, with a preview of matching emails before you save.
At the scheduled time (or when you click Run on the dashboard) spam-digest runs these steps.
It connects over IMAP, opens the spam folder (trying common names if the configured one is missing) and reads only the headers of the newest emails.
Emails matching a blocklist rule are deleted, and emails from trusted senders or matching an allowlist rule are moved to INBOX, in the same IMAP session.
If enabled, sender and subject of the remaining emails go to Claude, which labels each one probably legitimate, uncertain or spam.
The digest is emailed via SMTP or Resend, with freshly signed links to the review page, the filters page and the delete button. Older links stop working.
From the links you rescue, trust or delete. Every action touches only the emails listed in that digest.
All you need is Docker with Compose. Official images are published for every release:
# Get the compose file mkdir spam-digest && cd spam-digest curl -LO https://raw.githubusercontent.com/gioxx/spam-digest/main/docker-compose.yml # Set your IMAP, SMTP and (optional) AI settings nano docker-compose.yml # Start docker compose up -d
The dashboard is at http://localhost:8080. Set TZ to your timezone: the schedule uses it.
environment: IMAP_SERVER: imap.example.com EMAIL_USER: you@example.com EMAIL_PASS: your-imap-password SMTP_HOST: smtp.example.com SMTP_USER: you@example.com SMTP_PASS: your-smtp-password # Optional: AI triage and web actions AI_PROVIDER: anthropic AI_API_KEY: sk-ant-... WEB_BASE_URL: https://spamdigest.example.com
WEB_BASE_URL is the public address of the dashboard: without it the digest has no review, filters or delete links.
docker compose pull && docker compose up -d
Pin a release (e.g. gfsolone/spam-digest:0.7.0) instead of latest to upgrade on your own schedule.
The full documentation lives on kb.gioxx.org, next to Clean Mail Automation, a related tool that deletes old emails from IMAP folders.
Docker Compose for one mailbox, then multi-mailbox with MAILBOX_CONFIGS.
IMAP, email delivery (SMTP or Resend), AI, schedule and web settings.
What is sent to Claude, the three labels, model choice and cost.
Review, filters and delete links: how they are signed, rotated and limited.
--dry-run, --force-send, --only, and running outside Docker.
Folder not found, SSL errors, links that stop working, emails not sent.