← 返回 Skills 市场
lgwanai

mail-skill

作者 lgwanai · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ 安全检测通过
161
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install mail-skills
功能描述
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...
使用说明 (SKILL.md)

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 read the original email to get context and sender, then use send with Re: \x3Csubject> and the recipient's address.
  • Smart Summarization: Use the summarize command for quick professional reports. For deeper analysis of a single thread, use read and analyze the content directly.
安全使用建议
What to consider before installing and using this skill: - Credentials: This skill needs your email address and password/app-specific password (IMAP/SMTP). Prefer creating and using an app-specific password or a dedicated mailbox account rather than your primary account. Do not paste credentials into a public place. - Local storage: The skill saves full raw emails (.eml), JSON, and attachments under mail_data (per-account directories). Ensure you are comfortable with those files residing on disk, and that the agent process has only the filesystem/network access you intend. - Registry metadata mismatch: The registry entry shows no required env vars, but the code and example.env clearly expect MAIL_ACCOUNT_* settings. Treat this as a transparency problem — the skill will read .env or environment variables to obtain credentials. - Agent permissions: The agent (or platform) may be able to read saved attachments and email text and could transmit them if given network/file permissions. Limit the agent's outbound/network permissions and consider running the skill in an isolated environment if you are concerned. - Code review: The provided Python code appears to use only IMAP/SMTP and local I/O (no external webhooks or remote upload). If you have the capability, review or run the code in a sandboxed environment first to confirm behavior. Pay attention to any logging or debug prints that might leak info. - Operational hygiene: Rotate credentials if you stop using the skill, restrict mailbox settings (enable app passwords, disable less-secure access), and securely delete mail_data when needed. If you need higher assurance, ask the skill publisher to update registry metadata to declare required env vars and clearly document storage paths, or run the skill against a throwaway mailbox first.
功能分析
Type: OpenClaw Skill Name: mail-skills Version: 1.1.0 The skill provides a comprehensive email management system using IMAP/SMTP with local SQLite indexing. It includes features for fetching, searching, reading, and sending emails, as well as a summarization tool that extracts verification codes and categorizes important messages. While the automated extraction of 2FA codes and the directive for the agent to 'immediately' summarize new emails could be targeted by indirect prompt injection from malicious emails, these are documented features intended for user convenience, and there is no evidence of intentional malice, hidden exfiltration, or unauthorized execution in the code (scripts/mail_cli.py, scripts/mail_manager/client.py).
能力评估
Purpose & Capability
Name/description (mail management: fetch, search, read, send, summarize) align with included code. The client, DB, and CLI implement IMAP/SMTP fetching/sending, local SQLite indexing, attachment storage, search, and summarization flows described in SKILL.md.
Instruction Scope
SKILL.md instructs the agent to load a .env with email credentials, run the provided CLI, fetch emails to local storage, and summarize results — all within the stated purpose. It also directs the agent to save raw EMLs, JSON, and attachments locally and to read those files for summarization. This is expected for a local mail manager but grants the agent access to potentially sensitive mailbox contents and attachments.
Install Mechanism
No install spec; code is delivered directly in the skill bundle and depends on common Python packages (imap-tools, python-dotenv, beautifulsoup4, jinja2) listed in requirements.txt. No remote downloads or obscure install hosts are used.
Credentials
The skill requires mailbox credentials, IMAP/SMTP host and port, and writes/reads local mail storage (example.env documents these), but registry metadata declares no required env vars or primary credential. That mismatch is security-relevant: installing agents should expect to provide email passwords/app-specific passwords and permit the skill to read/write the mail_data directory. The number and sensitivity of these credentials is proportional to the functionality (email access), but the absence of declared required env vars in registry metadata reduces transparency.
Persistence & Privilege
always is false; the skill runs on demand and uses background processes/tasks that write to a local tasks directory and per-account mail_data. It does not request permanent platform-wide privileges or modify other skills. Background task files and local DB are normal for this functionality.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install mail-skills
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /mail-skills 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
- Removed the file `idea.md` to clean up unused or outdated documentation. - No changes were made to code or user-facing documentation. - Version number updated to 1.1.0.
v1.0.0
- Initial release of mail-skill (v1.0.0) for comprehensive email management. - Provides a robust command-line interface for fetching, searching, reading, sending, replying, forwarding, and managing emails via IMAP/SMTP. - Utilizes a local SQLite database index to avoid duplicate fetches and enable fast searching. - Supports email summarization, exporting data, and various bulk operations with clear workflow via CLI. - Multi-account handling and attachment management included. - Installation and configuration guidance provided in README and example.env.
元数据
Slug mail-skills
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

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。

💬 留言讨论