邮件监听器

imap-idle-watcher

by axellageraldinc

>

4.4k平台与服务未扫描2026年3月23日

安装

claude skill add --url github.com/openclaw/skills/tree/main/skills/axellageraldinc/imap-idle-watcher

文档

IMAP IDLE Watcher

Real-time email watcher. Uses IMAP IDLE (server push) instead of polling. App passwords instead of OAuth — no token expiry, no re-auth.

Quick Start

Interactive

bash
bash scripts/setup_service.sh

Prompts for email, detects provider, gives app password link, tests connection, installs service.

Non-interactive

bash
bash scripts/setup_service.sh \
  --account "user@gmail.com" \
  --password "xxxx xxxx xxxx xxxx" \
  --command "python3 /path/to/handler.py" \
  --service-name my-watcher

Test connection only

bash
bash scripts/setup_service.sh --test --account "user@gmail.com" --password "xxxx"

Configuration (env vars)

VariableDefaultDescription
IMAP_ACCOUNT(required)Email address
IMAP_PASSWORD(required)App password
IMAP_HOSTimap.gmail.comIMAP server (auto-detected from email)
IMAP_PORT993IMAP port
IMAP_FOLDERINBOXFolder to watch
ON_NEW_MAIL_CMD(optional)Shell command to run on new mail
FILTER_FROM(optional)Only trigger for these senders (comma-separated, substring match)
FILTER_SUBJECT(optional)Only trigger for these subjects (comma-separated, substring match)
IDLE_TIMEOUT1200Seconds before IDLE renewal (max 1740)
DEBOUNCE_SECONDS10Min seconds between command runs

Filtering

Only process emails matching specific senders or subjects:

bash
FILTER_FROM=paypal.com,stripe.com      # from contains either (OR)
FILTER_SUBJECT=payment,invoice         # subject contains either (OR)
  • Case-insensitive substring match
  • Both FROM and SUBJECT must match if both set (AND)
  • Within each filter, any value matches (OR)
  • No filter set = process all emails

Writing a Handler

The agent should write a handler script based on the user's intent. The daemon passes email metadata as env vars:

VariableExample
MAIL_FROMJohn Doe <john@example.com>
MAIL_SUBJECTYour order has shipped
MAIL_DATEMon, 17 Mar 2026 10:30:00 +0700
MAIL_UID12345

Workflow

  1. User describes what they want (e.g. "watch my inbox, summarize new emails")
  2. Agent writes a handler script (Python/Bash) that reads the env vars and does what the user asked
  3. Agent saves it somewhere persistent (e.g. ~/email-handler.py)
  4. Agent runs setup_service.sh with --command "python3 ~/email-handler.py"

Example: user says "notify me about new emails"

Agent writes ~/email-handler.py:

python
#!/usr/bin/env python3
import os
print(f"New mail from {os.environ.get('MAIL_FROM', '?')}: {os.environ.get('MAIL_SUBJECT', '?')}")

Then wires it up:

bash
bash scripts/setup_service.sh --account "user@gmail.com" --password "xxxx" \
  --command "python3 ~/email-handler.py"

The handler is the agent's job — adapt it to whatever the user needs.

How It Works

  1. Connects to IMAP server with app password (SSL)
  2. Enters IDLE mode — server holds connection open
  3. Server pushes notification when new mail arrives (instant, no polling)
  4. Daemon runs ON_NEW_MAIL_CMD with email metadata as env vars (MAIL_FROM, MAIL_SUBJECT, MAIL_DATE, MAIL_UID)
  5. Returns to IDLE. Renews every 20 min per RFC 2177.
  6. Auto-reconnects on disconnect (backoff: 5s → 10s → 30s → 60s → 120s)

Service Management

bash
systemctl status <service-name>
journalctl -u <service-name> -f
systemctl restart <service-name>
systemctl stop <service-name>

Uninstall

bash
bash scripts/setup_service.sh --uninstall --service-name <service-name>

Provider Setup Guides

Troubleshooting

See references/troubleshooting.md for common errors and fixes.

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描124.4k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描124.4k

邮件模板

by alirezarezvani

Universal
热门

快速搭建生产可用的事务邮件系统:生成 React Email/MJML 模板,接入 Resend、Postmark、SendGrid 或 AWS SES,并支持本地预览、i18n、暗色模式、反垃圾优化与追踪埋点。

面向营销与服务场景,快速搭建高质量邮件模板,省去反复设计与切图成本,成熟度和社区认可都很高。

平台与服务
未扫描12.8k

相关 MCP 服务

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
84.6k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.6k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
39.0k

评论