/install mail-skills
Mail Management Skill
This skill provides a robust command-line interface (scripts/mail_cli.py) for managing emails across multiple accounts.
Core Capabilities
- Fetch: Retrieve emails via IMAP and save them locally (.eml, .json, and SQLite index). Skips already downloaded emails based on
message_id. - Search: Query the local database for fast retrieval based on sender, subject, content, and date.
- Read: View the full content of an email, including its text and attachment metadata.
- Send/Reply/Forward: Send new emails or reply/forward existing ones via SMTP.
- Manage: Mark as read/starred, move between folders, or delete emails.
- Summarize: Since the skill provides full email text, you (Claude/Trae) can use your own intelligence to summarize the content, extract to-dos, or identify key dates.
Workflow
1. Initial Setup
The user must provide an .env file in the root directory (or use example.env as a template). Ensure python-dotenv, imap-tools, beautifulsoup4 are installed (pip install -r requirements.txt).
2. Fetching Emails
Fetching emails is an asynchronous process because it can take time. When you run the fetch command, it will return a task_id immediately.
./scripts/mail_cli.py fetch --limit 50 --days 7
Note: If you need to fetch more than 100 emails, you MUST append the --confirm flag, and you should ask the user for confirmation first.
Check the status of the fetch task using the returned task_id:
./scripts/mail_cli.py fetch-status "\x3Ctask_id>"
Wait a few seconds and poll the status until it returns "status": "completed". Once completed, you MUST immediately use the summarize command to generate a professional report for the user, passing the task_id so it only summarizes the newly fetched emails:
./scripts/mail_cli.py summarize --task-id "\x3Ctask_id>"
3. Summarizing Emails
Generate a professional, categorized Markdown report of emails (overall stats, verification codes, important emails, action required, and others):
./scripts/mail_cli.py summarize --task-id "\x3Ctask_id>"
If you just want to summarize recent emails without a specific task:
./scripts/mail_cli.py summarize --limit 20
4. Searching Emails
Search locally first. This is much faster and doesn't hit the server:
./scripts/mail_cli.py search --query "meeting" --limit 10
./scripts/mail_cli.py search --sender "[email protected]" --is-read 0
5. Reading an Email
To read the full text and get attachment info, use the message_id from the search results:
./scripts/mail_cli.py read "\x3Cmessage_id>"
6. Sending Emails
./scripts/mail_cli.py send --to "[email protected]" --subject "Hello" --body "Message body" --attach "path/to/file1" "path/to/file2"
7. Managing Emails
- Mark:
./scripts/mail_cli.py mark "\x3Cmessage_id>" --read 1 --starred 1 - Move:
./scripts/mail_cli.py move "\x3Cmessage_id>" "Archive" - Delete:
./scripts/mail_cli.py delete "\x3Cmessage_id>"
8. Exporting
Export local database for analysis:
./scripts/mail_cli.py export --format csv --output emails.csv
Best Practices
- Always Search Local First: Do not fetch unless the user explicitly asks to "check for new emails" or if a local search yields no results.
- Handling Replies: To reply, first
readthe original email to get context and sender, then usesendwithRe: \x3Csubject>and the recipient's address. - Smart Summarization: Use the
summarizecommand for quick professional reports. For deeper analysis of a single thread, usereadand analyze the content directly.
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install mail-skills - 安装完成后,直接呼叫该 Skill 的名称或使用
/mail-skills触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
mail-skill 是什么?
Comprehensive email management skill. Use this skill when the user wants to fetch, search, read, send, reply to, move, delete, mark, or summarize emails. It... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 161 次。
如何安装 mail-skill?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install mail-skills」即可一键安装,无需额外配置。
mail-skill 是免费的吗?
是的,mail-skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
mail-skill 支持哪些平台?
mail-skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 mail-skill?
由 lgwanai(@lgwanai)开发并维护,当前版本 v1.1.0。