← Back to Skills Marketplace
lgwanai

mail-skill

by lgwanai · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ Security Clean
161
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install mail-skills
Description
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...
README (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.
Usage Guidance
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.
Capability Analysis
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).
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install mail-skills
  3. After installation, invoke the skill by name or use /mail-skills
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug mail-skills
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 161 downloads so far.

How do I install mail-skill?

Run "/install mail-skills" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is mail-skill free?

Yes, mail-skill is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does mail-skill support?

mail-skill is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created mail-skill?

It is built and maintained by lgwanai (@lgwanai); the current version is v1.1.0.

💬 Comments