返回顶部
e

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 (HTML + Excel), and optionally send it via email. Trigger when user says "summarize my emails", "check recent emails", "analyze my contacts", "profile email contacts", "parse pst file", "analyze outlook export", "send contact report", etc.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.4
安全检测
已通过
145
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

email-summarizer

邮件摘要生成器 + 联系人画像工具

三个独立阶段 — 根据需求运行任意子集:

[数据源] [分析] [投递]
fetch_imap.py ──→ ──→
parsefile.py ──→ buildreport.py ──→ send_report.py
→ .html + .xlsx

每个阶段从文件读取/写入文件(或标准输入/输出),因此可自由组合。



安装

bash

Python 依赖


pip install -r requirements.txt

Node.js 依赖(仅用于原生 .pst 解析)

cd scripts && npm install && cd ..

脚本参考

阶段 1 — 数据源

fetch_imap.py — 从实时 IMAP 邮箱获取邮件

bash
export EMAIL_USER=you@163.com
export EMAIL_PASS=your-app-password

获取最近 7 天(仅收件箱)→ emails.json

python3 scripts/fetch_imap.py --days 7 --output emails.json

获取日期范围,收件箱 + 已发送

python3 scripts/fetch_imap.py --since 2026-03-01 --until 2026-03-28 \ --with-sent --preset 163 --output emails.json

直接管道传输到 build_report.py(无需中间文件)

python3 scripts/fetchimap.py --days 30 | python3 scripts/buildreport.py --output report
参数默认值描述
--days N7获取最近 N 天。如果设置了 --since 则忽略。
--since DATE
— | 开始日期(包含,YYYY-MM-DD) | | --until DATE | — | 结束日期(不包含,YYYY-MM-DD,默认:今天) | | --max N | 200 | 每个文件夹最大邮件数 | | --folder NAME | INBOX | 收件箱文件夹名称 | | --preset NAME | 163 | 邮箱预设:163 \| qq \| exmail \| gmail \| outlook | | --with-sent | 关闭 | 同时获取已发送文件夹(建议用于关系分析) | | --output FILE | stdout | 将 JSON 写入文件;省略则输出到标准输出 |

支持的预设:

预设IMAP 服务器已发送文件夹
163imap.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 — 解析本地邮件导出文件

bash

解析 .pst 文件(原生引擎,无需系统安装)


python3 scripts/parse_file.py --pst ~/Downloads/archive.pst --output emails.json

解析 .mbox 文件(收件箱 + 已发送)

python3 scripts/parse_file.py --mbox Inbox.mbox --sent-mbox Sent.mbox --output emails.json

解析 .msg 文件文件夹,按日期过滤

python3 scripts/parse_file.py --msg-dir ./exported/ --since 2026-01-01 --output emails.json

管道传输到 build_report.py

python3 scripts/parsefile.py --pst archive.pst | python3 scripts/buildreport.py --output report
参数默认值描述
--pst FILEOutlook .pst 存档
--mbox FILE
— | Unix mbox 文件 | | --msg-dir DIR | — | .msg 文件文件夹 | | --sent-mbox FILE | — | 额外的已发送邮件 mbox(与 --mbox 一起使用) | | --pst-engine | auto | auto \| native \| readpst | | --days N | all | 仅包含最近 N 天 | | --since DATE | — | 开始日期(包含,YYYY-MM-DD) | | --until DATE | — | 结束日期(不包含,YYYY-MM-DD) | | --max N | 500 | 最大加载邮件数 | | --output FILE | stdout | 将 JSON 写入文件;省略则输出到标准输出 |

PST 引擎:

引擎参数要求
原生(默认)--pst-engine nativecd scripts && npm install
Readpst
--pst-engine readpst | apt install pst-utils 或 brew install libpst |
| 自动 | --pst-engine auto | 优先尝试原生引擎,失败则回退到 readpst |


阶段 2 — 分析

build_report.py — 分析邮件 → HTML + Excel 报告

bash

从文件


python3 scripts/build_report.py --input emails.json --output report

明确指定所有者(分析他人 PST 时)

python3 scripts/build_report.py --input emails.json --output report \ --owner xiang-xiang.hu@connect.polyu.hk

从标准输入(从阶段 1 管道传输)

python3 scripts/fetchimap.py --days 30 | python3 scripts/buildreport.py --output report
参数默认值描述
--input FILEstdin阶段 1 输出的邮件 JSON 路径
--output PREFIX
contact_report | 输出路径前缀。生成 .html 和 .xlsx | | --owner EMAIL | 自动推断 | 邮箱所有者地址。省略时自动检测。 |

输出文件:

  • - .html — 自包含 HTML 报告(在浏览器中打开或附加到邮件)
  • .xlsx — 包含相同数据的 Excel 电子表格

报告列:# / 首选名称 / 邮箱 / 公司 / 职位 / 主题摘要 / 来源 / 邮件数(收/发)



阶段 3 — 投递

send_report.py — 通过 SMTP 发送报告文件

bash
export EMAIL_USER=you@163.com
export EMAIL_PASS=your-app-password

向收件人发送 HTML + Excel

python3 scripts/send_report.py \ --html report.html --xlsx report.xlsx --to friend@example.com

发送给自己(EMAIL_USER)

python3 scripts/send_report.py --html report.html --xlsx report.xlsx

仅 HTML(无附件)

python3 scripts/send_report.py --html report.html --to friend@example.com

自定义主题

python3 scripts/send_report.py --html report.html --subject 三月联系人报告
参数默认值描述
--html FILE必需用作邮件正文的 HTML 文件
--xlsx FILE
— | 要附加的 Excel 文件(可选) | | --to ADDR | EMAIL_USER | 收件人地址 | | --subject STR | 自动 | 邮件主题(省略时自动生成) | | --preset NAME | 163 | SMTP 预设:163 \| qq \| exmail \| gmail \| outlook |

私有库模块(非独立脚本)

文件提供功能
core.pydecodeheader、parseaddr、getdomain、striphtml、htmlesc、getbody
analyze.py
inferowner、buildcontacts、域名/公司/职位/名称推断 | | render.py | buildreporthtml、buildexcel、SMTP_MAP |

完整工作流示例

A — IMAP 邮箱 → 报告 → 发送给自己

bash
export EMAIL_USER=you@163.com
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

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 email-summarizer-1775994201 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 email-summarizer-1775994201 技能

通过命令行安装

skillhub install email-summarizer-1775994201

下载

⬇ 下载 email-summarizer v1.0.4(免费)

文件大小: 28.5 KB | 发布时间: 2026-4-13 10:09

v1.0.4 最新 2026-4-13 10:09
- 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.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部