email-triage

IMAP email scanning and triage with AI classification via a local Ollama LLM. Scans unread emails, categorizes them as urgent, needs-response, informational, or spam, and surfaces important messages for agent consumption. Works standalone with heuristic fallback — Ollama optional but recommended.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "email-triage" with this command: npx skills add briancolinger/email-triage

Email Triage

Scan your IMAP inbox, classify emails into priority categories, and surface the ones that need attention. Uses a local LLM (Ollama) for intelligent classification with a rule-based heuristic fallback when Ollama is unavailable.

Prerequisites

  • Python 3.10+
  • IMAP-accessible email account (Gmail, Fastmail, self-hosted, etc.)
  • Ollama (optional) — for AI-powered classification. Without it, the script uses keyword-based heuristics that still work well for common patterns.

Categories

IconCategoryDescription
🔴urgentOutages, security alerts, legal, payment failures, time-critical
🟡needs-responseBusiness inquiries, questions, action items requiring a reply
🔵informationalReceipts, confirmations, newsletters, automated notifications
spamMarketing, promotions, unsolicited junk

Configuration

All configuration is via environment variables:

VariableRequiredDefaultDescription
IMAP_HOSTIMAP server hostname
IMAP_PORT993IMAP port (SSL)
IMAP_USERIMAP username / email address
IMAP_PASSIMAP password or app-specific password
EMAIL_TRIAGE_STATE./data/email-triage.jsonPath to the JSON state file
OLLAMA_URLhttp://127.0.0.1:11434Ollama API endpoint
OLLAMA_MODELqwen2.5:7bOllama model for classification

Directories Written

  • EMAIL_TRIAGE_STATE (default: ./data/email-triage.json) — Persistent state file tracking classified emails and surfacing status

Commands

# Scan inbox and classify new unread emails
python3 scripts/email/email-triage.py scan

# Scan with verbose output (shows each classification)
python3 scripts/email/email-triage.py scan --verbose

# Dry run — scan and classify but don't save state
python3 scripts/email/email-triage.py scan --dry-run

# Show unsurfaced important emails (urgent + needs-response)
python3 scripts/email/email-triage.py report

# Same as report but JSON output (for programmatic use)
python3 scripts/email/email-triage.py report --json

# Mark reported emails as surfaced (so they don't appear again)
python3 scripts/email/email-triage.py mark-surfaced

# Show triage statistics
python3 scripts/email/email-triage.py stats

How It Works

  1. Connects to IMAP over SSL and fetches unread messages (up to 20 per scan).
  2. Deduplicates by Message-ID (or a hash of subject + sender as fallback) so emails are never classified twice.
  3. Classifies each email using Ollama if available, otherwise falls back to keyword heuristics.
  4. Stores state in a local JSON file — tracks category, reason, and whether the email has been surfaced.
  5. report surfaces only unsurfaced urgent and needs-response emails, sorted by priority.
  6. mark-surfaced flags reported emails so they won't appear in future reports.
  7. Auto-prunes state to the most recent 200 entries to prevent unbounded growth.

Integration Tips

  • Heartbeat / cron: Run scan periodically, then report --json to check for items needing attention.
  • Agent workflow: scanreport --json → act on results → mark-surfaced.
  • Without Ollama: The heuristic classifier handles common patterns (automated notifications, marketing, urgent keywords) well. Ollama adds nuance for ambiguous emails.
  • App passwords: If your provider uses 2FA, generate an app-specific password for IMAP access.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Hot Content Creator

热点内容创作助手:自动抓取多平台热点,筛选创作方向,生成小红书封面图和虚拟博主形象, 写出有人味的爆款内容。触发词:热点创作、追热点、创作方向、小红书方向、抖音方向。 适用场景:需要从热点中挖掘内容创作方向并生成配图+文案的完整工作流。

Registry SourceRecently Updated
General

飞书 Markdown 文档发布器,完美支持支持图片、表格

将 Markdown 文件发布为飞书(Feishu/Lark)在线文档。 支持完整的 Markdown 语法,包括标题、段落、表格、有序/无序列表、 待办事项、分隔线、加粗/斜体等富文本样式。 当用户需要将本地 Markdown 文件同步或发布到飞书文档时使用。

Registry SourceRecently Updated
General

Publish V3

One window, three emotions. Switch between Lover / Buddy / Rival anytime. Lightweight nurturing, mood persistence, gamified stats, auto-degradation dual mode...

Registry SourceRecently Updated
General

Startup Adaptation Strategist

Анализ и адаптация западных стартапов с проверенным PMF для быстрого запуска MVP на российском рынке с учётом санкций и локальных требований.

Registry SourceRecently Updated