126.com 网易邮箱 CLI,支持收取/发送、搜索、管理和统计邮件。触发词:邮件、邮箱、email、发/收/查邮件、126邮箱。支持调用其他 skill 与定时任务,输出 JSON。
模块命令功能初始化init创建数据目录和默认配置配置config setup / verify配置邮箱账号和授权码、验证连接收件箱inbox list / read / search列出、读取、搜索邮件发送send / reply / forward发送新邮件、回复、转发管理manage mark / delete / move标记已读/未读、删除、移动邮件统计stats today / range / by-sender / folders邮件统计分析
服务地址端口协议IMAPimap.126.com993SSLSMTPsmtp.126.com465SSLPOP3pop.126.com995SSL
注意: 使用本工具前,用户需要在网易邮箱设置中开启 IMAP/SMTP 服务并获取「授权码」(非登录密码)。
首次使用时:
bash
# Step 1: 初始化数据目录
python3 SKILL_DIR/scripts/mail_manager.py init
# Step 2: 配置邮箱账号(需要用户提供邮箱地址和授权码)
python3 SKILL_DIR/scripts/mail_manager.py config setup --email "user@126.com" --auth-code "XXXXXXXXXX"
# Step 3: 验证连接
python3 SKILL_DIR/scripts/mail_manager.py config verify
如果用户未提供授权码, 主动引导:
bash
# 列出最近10封邮件
python3 SKILL_DIR/scripts/mail_manager.py inbox list --limit 10
# 列出指定文件夹的邮件(已发送、草稿等)
python3 SKILL_DIR/scripts/mail_manager.py inbox list --folder "Sent Messages" --limit 5
# 读取邮件详情
python3 SKILL_DIR/scripts/mail_manager.py inbox read --uid 12345
# 搜索邮件 - 按发件人
python3 SKILL_DIR/scripts/mail_manager.py inbox search --from "sender@example.com"
# 搜索邮件 - 按主题和日期
python3 SKILL_DIR/scripts/mail_manager.py inbox search --subject "会议" --since "2026-04-01"
# 搜索邮件 - 按日期范围
python3 SKILL_DIR/scripts/mail_manager.py inbox search --since "2026-04-01" --until "2026-04-11"
bash
# 发送新邮件
python3 SKILL_DIR/scripts/mail_manager.py send \
--to "recipient@example.com" \
--subject "测试邮件" \
--body "这是一封测试邮件的内容。"
# 发送带抄送的邮件
python3 SKILL_DIR/scripts/mail_manager.py send \
--to "a@b.com,c@d.com" \
--cc "e@f.com" \
--subject "会议通知" \
--body "明天下午3点开会。"
# 发送带附件的邮件
python3 SKILL_DIR/scripts/mail_manager.py send \
--to "a@b.com" \
--subject "文件" \
--body "请查收附件" \
--attachments "/path/to/file1.pdf,/path/to/file2.docx"
# 回复邮件
python3 SKILL_DIR/scripts/mail_manager.py reply --uid 12345 --body "收到,谢谢!"
# 转发邮件
python3 SKILL_DIR/scripts/mail_manager.py forward --uid 12345 --to "forward@target.com" --note "请查看此邮件"
bash
# 标记已读
python3 SKILL_DIR/scripts/mail_manager.py manage mark --uid 12345 --flag read
# 标记未读
python3 SKILL_DIR/scripts/mail_manager.py manage mark --uid 12345 --flag unread
# 标记星标
python3 SKILL_DIR/scripts/mail_manager.py manage mark --uid 12345 --flag starred
# 取消星标
python3 SKILL_DIR/scripts/mail_manager.py manage mark --uid 12345 --flag unstarred
# 删除邮件
python3 SKILL_DIR/scripts/mail_manager.py manage delete --uid 12345
# 移动邮件到指定文件夹
python3 SKILL_DIR/scripts/mail_manager.py manage move --uid 12345 --folder "已处理"
bash
# 今日邮件统计
python3 SKILL_DIR/scripts/mail_manager.py stats today
# 指定日期范围统计
python3 SKILL_DIR/scripts/mail_manager.py stats range --since "2026-04-01" --until "2026-04-11"
# 按发件人统计 Top 10
python3 SKILL_DIR/scripts/mail_manager.py stats by-sender --limit 10
# 文件夹概览
python3 SKILL_DIR/scripts/mail_manager.py stats folders
bash
# 下载指定邮件的所有附件
python3 SKILL_DIR/scripts/mail_manager.py inbox download --uid 12345 --output-dir "/path/to/save"
# 下载指定邮件的特定附件
python3 SKILL_DIR/scripts/mail_manager.py inbox download --uid 12345 --attachment "report.pdf" --output-dir "/path/to/save"
中文名IMAP 文件夹名收件箱INBOX已发送Sent Messages草稿Drafts已删除Trash垃圾邮件Junk病毒邮件Virus
详细字段说明见 references/data-schema.md。
字段说明uid邮件唯一IDfrom发件人to收件人subject主题date日期flags标记(seen/flagged 等)size大小(字节)
字段说明uid邮件唯一IDfrom发件人to收件人列表cc抄送列表subject主题date日期body_text纯文本正文body_htmlHTML正文(如有)attachments附件列表(名称+大小)
所有命令输出 JSON:
json
// 成功
{
"status": "success",
"data": { ... },
"message": "操作描述"
}
// 失败
{
"status": "error",
"data": null,
"message": "错误描述"
}