← 返回 Skills 市场
momothemage

email-summarizer

作者 Momo · GitHub ↗ · v1.0.4 · MIT-0
cross-platform ✓ 安全检测通过
186
总下载
1
收藏
1
当前安装
5
版本数
在 OpenClaw 中安装
/install email-summarizer
功能描述
Email summary and contact profiling skill. Fetch emails from an IMAP mailbox or parse local exports (.pst / .mbox / .msg), build a contact profile report (HT...
使用说明 (SKILL.md)

Email Summarizer + Contact Profiler

Three independent stages — run any subset depending on what you need:

[Data Source]          [Analysis]          [Delivery]
fetch_imap.py    ──→                ──→
parse_file.py    ──→  build_report.py ──→  send_report.py
                       → .html + .xlsx

Each stage reads from / writes to files (or stdin/stdout), so they compose freely.


Installation

# Python dependencies
pip install -r requirements.txt

# Node.js dependency (only for native .pst parsing)
cd scripts && npm install && cd ..

Script Reference

Stage 1 — Data Source

fetch_imap.py — Fetch emails from a live IMAP mailbox

export [email protected]
export EMAIL_PASS=your-app-password

# Fetch last 7 days (inbox only) → emails.json
python3 scripts/fetch_imap.py --days 7 --output emails.json

# Fetch a date range, inbox + sent
python3 scripts/fetch_imap.py --since 2026-03-01 --until 2026-03-28 \
    --with-sent --preset 163 --output emails.json

# Pipe directly to build_report.py (no intermediate file)
python3 scripts/fetch_imap.py --days 30 | python3 scripts/build_report.py --output report
Flag Default Description
--days N 7 Fetch last N days. Ignored if --since is set.
--since DATE Start date inclusive (YYYY-MM-DD)
--until DATE End date exclusive (YYYY-MM-DD, default: today)
--max N 200 Max emails per folder
--folder NAME INBOX Inbox folder name
--preset NAME 163 Mailbox preset: 163 | qq | exmail | gmail | outlook
--with-sent off Also fetch Sent folder (recommended for relationship analysis)
--output FILE stdout Write JSON to file; prints to stdout if omitted

Supported presets:

Preset IMAP Server Sent folder
163 imap.163.com:993 已发送
qq imap.qq.com:993 Sent Messages
exmail imap.exmail.qq.com:993 Sent Messages
gmail imap.gmail.com:993 [Gmail]/Sent Mail
outlook outlook.office365.com:993 Sent Items

parse_file.py — Parse a local email export

# Parse a .pst file (native engine, no system install needed)
python3 scripts/parse_file.py --pst ~/Downloads/archive.pst --output emails.json

# Parse a .mbox file (inbox + sent)
python3 scripts/parse_file.py --mbox Inbox.mbox --sent-mbox Sent.mbox --output emails.json

# Parse a folder of .msg files, filter by date
python3 scripts/parse_file.py --msg-dir ./exported/ --since 2026-01-01 --output emails.json

# Pipe to build_report.py
python3 scripts/parse_file.py --pst archive.pst | python3 scripts/build_report.py --output report
Flag Default Description
--pst FILE Outlook .pst archive
--mbox FILE Unix mbox file
--msg-dir DIR Folder of .msg files
--sent-mbox FILE Additional sent-items mbox (with --mbox)
--pst-engine auto auto | native | readpst
--days N all Only include last N days
--since DATE Start date inclusive (YYYY-MM-DD)
--until DATE End date exclusive (YYYY-MM-DD)
--max N 500 Max emails to load
--output FILE stdout Write JSON to file; prints to stdout if omitted

PST engines:

Engine Flag Requires
Native (default) --pst-engine native cd scripts && npm install
Readpst --pst-engine readpst apt install pst-utils or brew install libpst
Auto --pst-engine auto Tries native first, falls back to readpst

Stage 2 — Analysis

build_report.py — Analyse emails → HTML + Excel report

# From a file
python3 scripts/build_report.py --input emails.json --output report

# Specify owner explicitly (when analysing someone else's PST)
python3 scripts/build_report.py --input emails.json --output report \
    --owner [email protected]

# From stdin (piped from Stage 1)
python3 scripts/fetch_imap.py --days 30 | python3 scripts/build_report.py --output report
Flag Default Description
--input FILE stdin Path to emails JSON from Stage 1
--output PREFIX contact_report Output path prefix. Writes \x3Cprefix>.html and \x3Cprefix>.xlsx
--owner EMAIL auto-inferred Mailbox owner address. Auto-detected if omitted.

Output files:

  • \x3Cprefix>.html — self-contained HTML report (open in browser or attach to email)
  • \x3Cprefix>.xlsx — Excel spreadsheet with the same data

Report columns: # / Preferred Name / Email / Company / Position / Subject Summary / Source / Emails (Recv/Sent)


Stage 3 — Delivery

send_report.py — Send report files via SMTP

export [email protected]
export EMAIL_PASS=your-app-password

# Send HTML + Excel to a recipient
python3 scripts/send_report.py \
    --html report.html --xlsx report.xlsx --to [email protected]

# Send to yourself (EMAIL_USER)
python3 scripts/send_report.py --html report.html --xlsx report.xlsx

# HTML only (no attachment)
python3 scripts/send_report.py --html report.html --to [email protected]

# Custom subject
python3 scripts/send_report.py --html report.html --subject "March Contact Report"
Flag Default Description
--html FILE required HTML file to use as email body
--xlsx FILE Excel file to attach (optional)
--to ADDR EMAIL_USER Recipient address
--subject STR auto Email subject (auto-generated if omitted)
--preset NAME 163 SMTP preset: 163 | qq | exmail | gmail | outlook

Private library modules (not standalone scripts)

File Provides
_core.py decode_header, parse_addr, get_domain, strip_html, html_esc, get_body
_analyze.py infer_owner, build_contacts, domain/company/position/name inference
_render.py build_report_html, build_excel, SMTP_MAP

Complete workflow examples

A — IMAP mailbox → report → send to self

export [email protected]
export EMAIL_PASS=your-app-password

python3 scripts/fetch_imap.py --days 30 --with-sent --output /tmp/emails.json
python3 scripts/build_report.py --input /tmp/emails.json --output /tmp/report
python3 scripts/send_report.py --html /tmp/report.html --xlsx /tmp/report.xlsx --preset 163

B — PST file → report → send to someone

python3 scripts/parse_file.py --pst ~/Downloads/archive.pst --output /tmp/emails.json
python3 scripts/build_report.py --input /tmp/emails.json --output /tmp/report
[email protected] EMAIL_PASS=xxx \
  python3 scripts/send_report.py --html /tmp/report.html --xlsx /tmp/report.xlsx \
    --to [email protected]

C — One-liner (pipe, no intermediate files)

python3 scripts/parse_file.py --pst archive.pst \
  | python3 scripts/build_report.py --output /tmp/report

D — Report only, no email (open locally)

python3 scripts/parse_file.py --mbox Inbox.mbox --output /tmp/emails.json
python3 scripts/build_report.py --input /tmp/emails.json --output /tmp/report
# Open /tmp/report.html in a browser

AI analysis templates

After loading the email JSON into the AI context, use the following templates:

Part A: 4-Dimension Email Summary

🔥 Part 1 — Important & Action Items
  🚨 [URGENT]    Subject — Sender — Date | Summary | Action | Deadline
  ⚡ [IMPORTANT] Subject — Sender — Date | Summary | Action
  📌 [NOTE]      Subject — Sender — Date | Summary

📊 Part 2 — Grouped by Sender / Topic

✅ Part 3 — To-Do List

📅 Part 4 — Timeline (YYYY-MM-DD  Sender → Subject: summary)

Part B: Contact Profile Analysis

Sort by total interactions. For each contact:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
👤 Rank #N | Name \x3Cemail>   Total: N (Recv: N / Sent: N)
🧑 Gender       M/F/Unknown  Confidence: H/M/L  Basis: …
💼 Role         …            Basis: domain / signature / keywords
🔗 Relationship Colleague / Client / Institution / Stranger
   Direction    Mutual / Owner-initiated / Contact-initiated
📝 Topics       • subject 1  • subject 2
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Heat scale: 🔥 Heavy (≥10) · ⚡ Active (5–9) · 💬 Moderate (2–4) · 🌙 Light (1)


Notes

  • Credentials are passed via environment variables — never hardcoded
  • IMAP connections use readonly mode — emails are never modified or deleted
  • Body text is truncated to 2000 characters per email
  • fetch_imap.py sends an RFC 2971 ID command required by 163/188 servers; harmless on others
安全使用建议
This skill appears to do exactly what it claims: parse local email exports or fetch via IMAP, build an HTML/XLSX contact report, and optionally send it over SMTP. Before installing/running: - Only provide an app-specific IMAP/SMTP password (EMAIL_PASS) or use an app password from your mailbox provider; avoid using your primary login password. - If you need PST parsing, the skill asks you to run `cd scripts && npm install`. Review package.json/package-lock and consider setting npm to the registry you trust (the included lockfile references a Tencent mirror). Verify pst-extractor's integrity or run npm install in an isolated VM/container if you are uncomfortable. - The scripts will call the bundled Node helper (node scripts/pst_extractor_helper.js) and may call the system readpst binary if you choose that engine. Both operate on local files only; confirm you’re pointing them at the intended export files. - send_report.py uses SMTP presets (163/qq/gmail/outlook); review SMTP_MAP if you want to confirm which SMTP hosts/ports will be contacted and that they match your expectations. - Reports and any attachments are written to disk; treat generated files as you would any sensitive export (store/delete securely). If you want to be extra cautious, run the skill in a disposable environment (container or VM) and inspect network activity during npm install and first run. Otherwise, the package is internally coherent and proportional to its stated purpose.
功能分析
Type: OpenClaw Skill Name: email-summarizer Version: 1.0.4 The email-summarizer skill is a legitimate tool designed to fetch, parse, and analyze email data from IMAP servers or local exports (.pst, .mbox, .msg) to generate contact profiles and summaries. It handles sensitive information such as email credentials and message content, but its implementation follows security best practices, such as using environment variables for secrets and invoking external processes (Node.js and readpst) via subprocess.run without shell=True. The logic in scripts like fetch_imap.py, parse_file.py, and _analyze.py is transparent and directly supports the stated purpose of the skill. No evidence of data exfiltration, malicious prompt injection, or unauthorized access was found.
能力评估
Purpose & Capability
Name/description (email summarization and contact profiling) align with the code and instructions. fetch_imap.py, parse_file.py, build_report.py, and send_report.py implement the described workflows. Node.js dependency (pst-extractor) is justified for native .pst parsing and readpst is offered as an alternative.
Instruction Scope
SKILL.md and scripts limit actions to reading local archives or connecting to IMAP/SMTP using credentials provided by the user. The skill reads/writes local files and may call a bundled Node helper or the system readpst binary when parsing .pst files; SKILL.md documents these calls and the code avoids shell=True and remote URLs during runtime. Scripts prompt for credentials if env vars are not set.
Install Mechanism
There is no platform install spec (instruction-only install). Runtime requires pip install -r requirements.txt and an optional npm install in scripts/. package-lock.json is included and shows resolved package tarballs served from a mirrors.tencent.com URL — npm install will pull pst-extractor (and transitive deps). This is a normal npm install flow but users may want to verify the registry/mirror and package integrity before running npm install in a sensitive environment.
Credentials
Only mailbox-related credentials (EMAIL_USER, EMAIL_PASS) and optional IMAP_HOST/IMAP_PORT are used; these are appropriate for IMAP fetch and SMTP send. The skill does not request unrelated cloud/provider keys or other secrets. Note: the registry metadata reported 'required env vars: none' while SKILL.md documents optional EMAIL_USER/EMAIL_PASS — this is a minor metadata mismatch (they are optional, not required).
Persistence & Privilege
The skill is not always-enabled and does not request elevated or persistent system privileges. It does not modify other skills or global agent settings. Autonomous invocation is allowed (platform default) but not combined with other privileged behaviors.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install email-summarizer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /email-summarizer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
- Declared all external subprocess usage in SKILL.md for security transparency, specifying which local executables are invoked, when, and with what arguments. - Clarified that no file changes were detected; this update modifies only documentation. - Now documents in detail the use of node.js and readpst binaries for .pst file parsing, including security notes (no shell usage, no dynamic commands, no network). - No behavioral or code changes; documentation now fully describes local executable usage for compliance review.
v1.0.3
**Refactored to a modular three-stage pipeline for summarizing and profiling email contacts:** - Replaced previous all-in-one and separate IMAP/local scripts with clear stage separation: data fetch/parse, report analysis, and delivery. - Added new scripts: `fetch_imap.py`, `parse_file.py`, `build_report.py`, `send_report.py`; removed legacy: `fetch_emails.py`, `parse_local.py`, `send_contact_report.py`. - Each stage is now composable and file/pipe-based for flexible workflows: fetch/parse → analyze → render/send. - Introduced standalone private library modules: `_core.py`, `_analyze.py`, `_render.py` for decoding, name/domain inference, and report formatting. - Skill now fully supports building both HTML and Excel reports from IMAP or local export sources, and sending them via SMTP. - Documentation updated to reflect new modular usage, scripts, and options.
v1.0.2
# email-summarizer 1.0.2 - Added scripts/package-lock.json to the repository. - This addition supports better dependency management for the Node.js components used in PST parsing.
v1.0.1
- Added requirements.txt listing core Python dependencies for parsing email files. - Added scripts/package.json for managing Node.js dependency (pst-extractor) used in native PST file parsing. - Documented installation steps and runtime dependencies for both Python (pip) and Node.js (npm) in SKILL.md. - No changes to skill functionality; this update adds dependency declarations and instructions to improve setup and local mode reliability.
v1.0.0
- Initial release of email-summarizer skill. - Fetch and summarize emails from various IMAP mailboxes and local file exports (.pst, .mbox, .msg). - Generates 4-dimension summaries: urgent/important emails, sender/project grouping, to-do list, and timeline. - Produces detailed contact profiles, including gender, role, and relationship analysis. - Supports both live mailbox (IMAP) and offline (file parsing) modes, including .pst native and readpst engines. - Triggers on phrases like “summarize my emails”, “profile email contacts”, and related commands.
元数据
Slug email-summarizer
版本 1.0.4
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 5
常见问题

email-summarizer 是什么?

Email summary and contact profiling skill. Fetch emails from an IMAP mailbox or parse local exports (.pst / .mbox / .msg), build a contact profile report (HT... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 186 次。

如何安装 email-summarizer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install email-summarizer」即可一键安装,无需额外配置。

email-summarizer 是免费的吗?

是的,email-summarizer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

email-summarizer 支持哪些平台?

email-summarizer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 email-summarizer?

由 Momo(@momothemage)开发并维护,当前版本 v1.0.4。

💬 留言讨论