返回顶部
i

imap-mailIMAP邮件

Personal email via your own IMAP/SMTP server. Send and receive emails, manage folders, and search messages using standard protocols — no third-party email platform required. Use when you need to check inbox, send emails, move messages between folders, search by sender/subject/date, list all mailboxes, schedule emails for future delivery, save attachments, or get push notifications for new mail (IMAP IDLE).

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.5.4
安全检测
已通过
526
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

imap-mail

IMAP 邮件技能

通过您自己的 IMAP/SMTP 服务器发送和接收电子邮件。

一个轻量级的本地 REST API(FastAPI)作为代理与邮件服务器之间的桥梁运行——无需第三方电子邮件平台。

设置(首次使用)

1. 安装依赖

bash
pip3 install fastapi uvicorn

2. 配置凭据

创建 /etc/imap-mail.env(或任意路径,然后设置 IMAPMAILENV):

env
MAILIMAPHOST=mail.example.com
MAILIMAPPORT=993
MAILSMTPHOST=mail.example.com
MAILSMTPPORT=465
MAIL_USER=agent@example.com
MAIL_PASS=yourpassword
MAILFROMNAME=MyAgent

3. 启动 API 服务器

bash

一次性 / 前台运行


python3 {baseDir}/scripts/mail-api.py

或作为 systemd 服务运行(推荐)

参见:{baseDir}/references/systemd.md

API 默认监听 http://127.0.0.1:8025。

检查邮件

bash

列出最近的消息


python3 {baseDir}/scripts/check_inbox.py --inbox agent@example.com

仅未读消息

python3 {baseDir}/scripts/check_inbox.py --inbox agent@example.com --unseen

指定文件夹

python3 {baseDir}/scripts/check_inbox.py --inbox agent@example.com --folder Sent

读取特定消息(使用列表输出中的 UID)

python3 {baseDir}/scripts/check_inbox.py --inbox agent@example.com --message 42

读取消息并保存所有附件

python3 {baseDir}/scripts/check_inbox.py --inbox agent@example.com --message 42 --save-attachments /tmp/mail/

列出线程

python3 {baseDir}/scripts/check_inbox.py --inbox agent@example.com --threads

列出所有文件夹

python3 {baseDir}/scripts/check_inbox.py --inbox agent@example.com --folders

搜索邮件

bash

按关键词搜索(主题 + 正文)


python3 {baseDir}/scripts/search.py --inbox agent@example.com --q invoice

按发件人搜索

python3 {baseDir}/scripts/search.py --inbox agent@example.com --from alice@example.com

按主题 + 日期范围搜索

python3 {baseDir}/scripts/search.py --inbox agent@example.com --subject meeting --since 2026-01-01

查找未读消息

python3 {baseDir}/scripts/search.py --inbox agent@example.com --unseen

查找带附件的消息并保存

python3 {baseDir}/scripts/search.py --inbox agent@example.com --has-attachments --save-attachments /tmp/mail/

仅查找 VIP 发件人的消息

python3 {baseDir}/scripts/search.py --inbox agent@example.com --vip

仅查找已标记/星标消息

python3 {baseDir}/scripts/search.py --inbox agent@example.com --flagged

查找特定发件人的已标记消息

python3 {baseDir}/scripts/search.py --inbox agent@example.com --from craig@example.com --flagged

组合筛选:自某个日期以来特定发件人的未读消息

python3 {baseDir}/scripts/search.py --inbox agent@example.com --from alice@example.com --since 2026-03-01 --unseen

包含特定主题关键词的未读消息

python3 {baseDir}/scripts/search.py --inbox agent@example.com --subject invoice --unseen

在特定文件夹中搜索

python3 {baseDir}/scripts/search.py --inbox agent@example.com --q report --folder Archive

收件箱排序(个人 vs 转发)

根据寻址方式自动将消息移动到子文件夹:

  • - 个人 — 收件箱地址直接在 To: 或 Cc: 中
  • 转发 — 主题以 Fwd: / FW: 开头,或包含 X-Forwarded- / Resent- 标头
  • 当两者都适用时,转发优先于个人

bash

预览将被移动的内容(不做更改)


python3 {baseDir}/scripts/sort_inbox.py --inbox agent@example.com --dry-run

排序所有消息

python3 {baseDir}/scripts/sort_inbox.py --inbox agent@example.com

仅排序未读消息

python3 {baseDir}/scripts/sort_inbox.py --inbox agent@example.com --unseen

自定义文件夹名称

python3 {baseDir}/scripts/sort_inbox.py --inbox agent@example.com \ --personal-folder MyInbox --forwarded-folder Forwards

排序特定源文件夹

python3 {baseDir}/scripts/sort_inbox.py --inbox agent@example.com --folder AllMail

两种类别都不匹配的消息(例如密送、群发邮件)保留在源文件夹中。



文件夹管理

bash

列出所有文件夹


python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --list

创建文件夹

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --create Archive

删除文件夹

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --delete OldFolder

将消息移动到另一个文件夹(使用 check_inbox 输出的 UID)

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --move 42 --to Archive

从特定源文件夹移动

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --move 5 --to INBOX --from-folder Junk

删除消息

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --delete-msg 42

将 INBOX 中的所有消息标记为已读

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --mark-seen

将特定文件夹中的所有消息标记为已读

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --mark-seen --from-folder Sent

将一条特定消息标记为已读(使用 check_inbox 输出的 UID)

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --mark-seen-uid 42

将多条特定消息标记为已读(空格分隔的 UID)

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --mark-seen-uid 42 55 73

将特定消息标记(星标)为重要

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --flag-uid 42 55 73

标记特定发件人的所有消息

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --flag-from craig@example.com python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --flag-from igor@example.com

移除消息标记

python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --unflag-uid 42 python3 {baseDir}/scripts/manage_folders.py --inbox agent@example.com --unflag-from craig@example.com

发送邮件

bash

发送纯文本邮件


python3 {baseDir}/scripts/send_email.py \
--to recipient@example.com \
--subject Hello \
--text Message body here

发送给多个收件人

python3 {baseDir}/scripts/send_email.py \ --to alice@example.com \ --to bob@example.com \ --subject Hello everyone \ --text Hi all!

回复消息(保留线程)

python3 {baseDir}/scripts/send_email.py \ --to sender@example.com \ --subject Re: Original Subject \ --text My reply \ --reply-to

联系人记忆(CRM)

每个联系人的持久化笔记和历史记录。已标记的发件人会被自动跟踪——当他们的消息到达时,代理会拉取完整上下文并详细报告。

bash

查找联系人的所有信息


python3 {baseDir}/scripts/manage_contacts.py --get craig@example.com

列出所有联系人

python3 {baseDir}/scripts/manage_

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 imap-mail-1776193144 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 imap-mail-1776193144 技能

通过命令行安装

skillhub install imap-mail-1776193144

下载

⬇ 下载 imap-mail v1.5.4(免费)

文件大小: 64.34 KB | 发布时间: 2026-4-15 13:39

v1.5.4 最新 2026-4-15 13:39
Fix silent output when --unseen finds no messages: cron jobs no longer print "No unread messages" noise. Added --quiet flag for explicit suppression.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部