← Back to Skills Marketplace
shiming-git

Simple Email

by shiming-git · GitHub ↗ · v1.0.1
cross-platform ✓ Security Clean
475
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install simple-email
Description
简单易用的 IMAP/SMTP 邮件技能。支持收发邮件、查看未读邮件、搜索、标记已读/未读、下载附件。兼容 Gmail、QQ 邮箱、163、新浪等所有标准 IMAP/SMTP 服务。
README (SKILL.md)

Simple Email - 简单易用的邮件技能

通过 IMAP 协议接收和管理邮件,通过 SMTP 协议发送邮件。支持所有标准 IMAP/SMTP 邮件服务,包括 Gmail、QQ 邮箱、163、新浪、Outlook 等。

🚀 快速开始

1. 安装依赖

cd skills/simple-email
npm install

2. 配置邮箱

复制配置模板并填写你的邮箱信息:

cp .env.example .env

编辑 .env 文件,填入你的邮箱配置:

# IMAP 配置(接收邮件)
IMAP_HOST=imap.sina.cn
IMAP_PORT=993
[email protected]
IMAP_PASS=your_password_or_auth_code
IMAP_TLS=true

# SMTP 配置(发送邮件)
SMTP_HOST=smtp.sina.cn
SMTP_PORT=465
SMTP_SECURE=true
[email protected]
SMTP_PASS=your_password_or_auth_code
SMTP_FROM=小智助理 \[email protected]>

# 安全配置(文件读写权限)
ALLOWED_READ_DIRS=C:\Users\Administrator\.openclaw\workspace
ALLOWED_WRITE_DIRS=C:\Users\Administrator\.openclaw\workspace

3. 测试连接

# 测试 SMTP 发送
node scripts/smtp.js test

# 检查收件箱
node scripts/imap.js check --limit 5

📥 接收邮件(IMAP)

检查新邮件

# 检查最新 10 封邮件
node scripts/imap.js check

# 检查最新 5 封邮件
node scripts/imap.js check --limit 5

# 只检查未读邮件
node scripts/imap.js check --unseen

# 检查最近 2 小时的邮件
node scripts/imap.js check --recent 2h

# 检查指定邮箱
node scripts/imap.js check --mailbox INBOX

搜索邮件

# 搜索未读邮件
node scripts/imap.js search --unseen

# 按发件人搜索
node scripts/imap.js search --from "[email protected]"

# 按主题搜索
node scripts/imap.js search --subject "报告"

# 搜索最近 7 天的邮件
node scripts/imap.js search --recent 7d

# 组合搜索
node scripts/imap.js search --unseen --from "[email protected]" --limit 10

查看邮件详情

# 查看指定 UID 的邮件
node scripts/imap.js fetch \x3Cuid>

标记已读/未读

# 标记为已读
node scripts/imap.js mark-read \x3Cuid1> \x3Cuid2> ...

# 标记为未读
node scripts/imap.js mark-unread \x3Cuid1> \x3Cuid2> ...

下载附件

# 下载邮件的所有附件
node scripts/imap.js download \x3Cuid>

# 下载到指定目录
node scripts/imap.js download \x3Cuid> --dir ./attachments

# 下载指定附件
node scripts/imap.js download \x3Cuid> --file report.pdf

列出所有邮箱

node scripts/imap.js list-mailboxes

📤 发送邮件(SMTP)

发送纯文本邮件

node scripts/smtp.js send --to [email protected] --subject "你好" --body "这是一封测试邮件"

发送 HTML 邮件

node scripts/smtp.js send --to [email protected] --subject "HTML 邮件" --html --body "\x3Ch1>你好\x3C/h1>\x3Cp>这是\x3Cstrong>HTML\x3C/strong>格式的邮件\x3C/p>"

发送带附件的邮件

node scripts/smtp.js send --to [email protected] --subject "报告" --body "请查收附件" --attach ./report.pdf

发送给多人

# 多个收件人
node scripts/smtp.js send --to "[email protected],[email protected]" --subject "通知" --body "大家好"

# 抄送
node scripts/smtp.js send --to [email protected] --cc "[email protected],[email protected]" --subject "抄送" --body "你好"

# 密送
node scripts/smtp.js send --to [email protected] --bcc "[email protected]" --subject "密送" --body "你好"

从文件读取内容

# 从文件读取邮件正文
node scripts/smtp.js send --to [email protected] --subject "报告" --body-file ./message.txt

# 从文件读取 HTML 内容
node scripts/smtp.js send --to [email protected] --subject "新闻稿" --html --html-file ./newsletter.html

# 从文件读取主题
node scripts/smtp.js send --to [email protected] --subject-file ./subject.txt --body-file ./body.txt

📋 常用邮箱服务器配置

服务商 IMAP 主机 IMAP 端口 SMTP 主机 SMTP 端口 说明
新浪邮箱 imap.sina.cn 993 smtp.sina.cn 465 使用授权码
QQ 邮箱 imap.qq.com 993 smtp.qq.com 587 使用授权码
163 邮箱 imap.163.com 993 smtp.163.com 465 使用授权码
126 邮箱 imap.126.com 993 smtp.126.com 465 使用授权码
Gmail imap.gmail.com 993 smtp.gmail.com 587 使用应用专用密码
Outlook outlook.office365.com 993 smtp.office365.com 587 使用应用密码

⚠️ 重要提示

Gmail 用户

  • Gmail 不接受常规账户密码
  • 必须生成 应用专用密码:https://myaccount.google.com/apppasswords
  • 需要启用两步验证

163/QQ/新浪邮箱用户

  • 使用 授权码,不是账户密码
  • 需要在网页版邮箱设置中先启用 IMAP/SMTP 服务
  • 授权码在邮箱设置 → 账户安全中获取

🔒 安全建议

  1. 不要提交 .env 文件到版本控制系统
  2. 使用授权码/应用密码,而不是账户密码
  3. 启用 SSL/TLS 加密连接
  4. 定期更换密码
  5. 限制 ALLOWED_READ_DIRSALLOWED_WRITE_DIRS 到必要的目录

🐛 常见问题

认证失败

  • 检查用户名是否为完整邮箱地址
  • 确认使用授权码/应用密码,而非账户密码
  • 检查是否已启用 IMAP/SMTP 服务

连接超时

  • 检查服务器地址和端口是否正确
  • 确认网络连接正常
  • 检查防火墙设置

TLS/SSL 错误

  • 确认 IMAP_TLSSMTP_SECURE 设置正确
  • 自签名证书可设置 IMAP_REJECT_UNAUTHORIZED=false

📝 命令速查

IMAP 命令

node scripts/imap.js check [--limit N] [--unseen] [--recent 2h]
node scripts/imap.js search [--unseen] [--from xxx] [--subject xxx]
node scripts/imap.js fetch \x3Cuid>
node scripts/imap.js mark-read \x3Cuid> [uid2 ...]
node scripts/imap.js mark-unread \x3Cuid> [uid2 ...]
node scripts/imap.js download \x3Cuid> [--dir ./path]
node scripts/imap.js list-mailboxes

SMTP 命令

node scripts/smtp.js send --to \x3Cemail> --subject \x3Ctext> --body \x3Ctext>
node scripts/smtp.js send --to \x3Cemail> --subject \x3Ctext> --html --body "\x3Chtml>..."
node scripts/smtp.js send --to \x3Cemail> --subject \x3Ctext> --attach \x3Cfile>
node scripts/smtp.js test

📄 许可证

MIT License

Usage Guidance
This skill appears to be what it claims: a Node.js IMAP/SMTP client. Before installing, consider the following: - Use an app-specific password or email authorization code and enable two-factor auth where possible; do not use your main mailbox password. - Create a dedicated mailbox/account for the skill if you want to limit blast radius. - Configure ALLOWED_READ_DIRS and ALLOWED_WRITE_DIRS narrowly (only the directories you actually need) — the scripts enforce these, so set them before enabling downloads or reading files. - Do not commit the generated .env to version control; setup.sh already warns and sets file permissions. - Verify the source/author if provenance matters: package.json lists "NetEase" as author but registry metadata shows source unknown; the homepage is a generic GitHub org. If you require stronger assurance, review the included scripts yourself or run them in an isolated environment/container. - If you need to automate agent-driven email sending, remember the skill will be able to send emails (it sends a test email during setup). Ensure that behavior aligns with your security policy. If you want additional assurance, ask for a short summary of any network endpoints contacted by the code (beyond IMAP/SMTP) and confirm there are no hard-coded external URLs — the provided files show none.
Capability Analysis
Type: OpenClaw Skill Name: simple-email Version: 1.0.1 The 'simple-email' skill provides standard IMAP and SMTP functionality for managing and sending emails. It includes proactive security measures, such as path whitelisting (validateReadPath and validateWritePath in imap.js and smtp.js) to prevent directory traversal and unauthorized file access. The setup.sh script correctly handles sensitive credentials by creating a .env file with restricted (600) permissions, and no evidence of data exfiltration, malicious execution, or prompt injection was found.
Capability Assessment
Purpose & Capability
Name/description (IMAP/SMTP email client) matches the requested binaries (node, npm), the required env vars (IMAP_* and SMTP_*), and included scripts (imap.js, smtp.js). The functionality requested (send/receive/search/download attachments) is coherent with the declared requirements.
Instruction Scope
SKILL.md instructs the agent to install node deps, create/edit a .env, and run the included scripts. The runtime instructions and code only perform mailbox operations and local file reads/writes (attachment download, reading body/subject files). The setup script sends a test email to the configured SMTP_USER (expected). There are no instructions to read unrelated system files or to transmit data to external endpoints beyond IMAP/SMTP servers.
Install Mechanism
No remote downloads from arbitrary hosts; dependencies are standard npm packages (package.json and package-lock.json present). The SKILL.md requires running npm install which is appropriate for a Node.js skill. No extract/URL-based installers are used.
Credentials
Declared required env vars (IMAP_HOST/USER/PASS, SMTP_HOST/USER/PASS) match code usage and are proportional. Note: the code and SKILL.md also rely on several optional env vars that are not listed in the registry metadata (ALLOWED_READ_DIRS, ALLOWED_WRITE_DIRS, IMAP_PORT/IMAP_TLS/SMTP_PORT/SMTP_SECURE/SMTP_FROM, IMAP_REJECT_UNAUTHORIZED/SMTP_REJECT_UNAUTHORIZED). ALLOWED_* are used to whitelist filesystem access (good practice), but the missing declaration is an inconsistency you should be aware of.
Persistence & Privilege
always is false and the skill does not request persistent system-wide privileges. setup.sh creates a local .env and sets permissions (chmod 600) but does not modify other skills or system-wide agent settings. Agent autonomous invocation is allowed (platform default) and not by itself a concern.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install simple-email
  3. After installation, invoke the skill by name or use /simple-email
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Removed `.env` and `.gitignore` files from the repository. - Strengthened security by preventing sensitive or configuration files from being included in version control.
v1.0.0
Initial release of simple-email 1.0.0: - 支持通过 IMAP/SMTP 协议收发邮件 - 可查看未读邮件、搜索、标记已读/未读、下载附件 - 提供 Gmail、QQ、163、新浪、Outlook 等主流邮箱兼容 - 支持多种命令行操作方式和批量操作 - 附带详细环境变量和安全配置说明 - 文档提供各类常见邮箱设置与故障排查指导
Metadata
Slug simple-email
Version 1.0.1
License
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Simple Email?

简单易用的 IMAP/SMTP 邮件技能。支持收发邮件、查看未读邮件、搜索、标记已读/未读、下载附件。兼容 Gmail、QQ 邮箱、163、新浪等所有标准 IMAP/SMTP 服务。 It is an AI Agent Skill for Claude Code / OpenClaw, with 475 downloads so far.

How do I install Simple Email?

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

Is Simple Email free?

Yes, Simple Email is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Simple Email support?

Simple Email is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Simple Email?

It is built and maintained by shiming-git (@shiming-git); the current version is v1.0.1.

💬 Comments