← 返回 Skills 市场
themsquared

Gmail Lead Monitor

作者 Mike · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
141
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gmail-lead-monitor
功能描述
Monitor a Gmail inbox for new emails matching keywords and send real-time Telegram alerts while starring important messages in Gmail.
使用说明 (SKILL.md)

Gmail Lead Monitor

Monitor any Gmail inbox and get instant Telegram alerts for important emails. Configure keywords to filter for leads, orders, or support inquiries. Zero dependencies beyond Python stdlib — no pip required.

What It Does

  • Connects to Gmail via IMAP (no OAuth, just app password)
  • Checks for new emails every N minutes (configurable)
  • Sends Telegram alert with sender, subject, and snippet
  • Detects important emails by keyword matching
  • Marks important emails with Gmail STAR flag
  • Tracks seen emails to avoid duplicate alerts

Setup

1. Enable Gmail App Password

  1. Go to myaccount.google.com/security
  2. Enable 2-Step Verification
  3. Go to App passwords → Generate new app password
  4. Select "Mail" and your device → Copy the 16-char password

2. Create Config File

mkdir -p ~/.config/gmail_monitor
cat > ~/.config/gmail_monitor/config.json \x3C\x3C 'EOF'
{
  "email": "[email protected]",
  "app_password": "xxxx xxxx xxxx xxxx",
  "telegram_token": "your_bot_token",
  "telegram_chat_id": "your_chat_id",
  "keywords": ["order", "purchase", "setup", "interested", "question", "invoice"],
  "check_interval_minutes": 5,
  "max_emails_per_check": 20
}
EOF

3. Get Telegram Bot Token

  1. Message @BotFather on Telegram
  2. /newbot → follow prompts
  3. Copy the bot token
  4. Get your chat ID from @userinfobot

Usage

# Run once (check now)
python3 gmail_monitor.py --once

# Run in daemon mode (default interval from config)
python3 gmail_monitor.py

# Custom interval
python3 gmail_monitor.py --interval 10

# Run via cron every 5 minutes
*/5 * * * * python3 /path/to/gmail_monitor.py --once >> /tmp/gmail_monitor.log 2>&1

Alert Example (Telegram)

📧 New Lead — Gmail
From: [email protected]
Subject: Question about your service
Time: 2025-03-15 14:22 PST

"Hi, I'm interested in your product and had a question about..."

⭐ Marked as important (keyword: question)

Keyword Matching

Keywords match against: subject line + sender name + first 200 chars of body. Case-insensitive. Add your own in config:

"keywords": ["order", "purchase", "invoice", "urgent", "setup", "question", "interested", "trial"]

Requirements

  • Python 3.6+
  • Gmail account with App Password enabled
  • Telegram bot (free)
  • Zero pip dependencies
安全使用建议
This skill appears to do exactly what it says, but it requires you to store sensitive credentials (Gmail App Password and Telegram bot token) in a local config file. Before installing, consider: 1) Only use a Gmail App Password (not your primary account password) and enable 2FA; rotate the app password if you stop using the tool. 2) Restrict the config file permissions (chmod 600 ~/.config/gmail_monitor/config.json and the seen_ids file) so other users on the system cannot read them. 3) Review the full script yourself or run it in a restricted environment (container or isolated VM) if you don't trust the unknown source. 4) Prefer running via cron/one-shot if you don't want a long-running daemon that keeps credentials on disk. 5) If you need stronger protection, integrate secrets with an OS keyring or secret manager rather than storing plaintext. Finally, verify the code you install matches the version you reviewed (source is unknown).
功能分析
Type: OpenClaw Skill Name: gmail-lead-monitor Version: 1.0.0 The skill is a legitimate utility for monitoring a Gmail inbox for specific keywords and sending alerts via a Telegram bot. The code in gmail_monitor.py uses standard Python libraries (imaplib, urllib) to perform its stated functions and does not contain any obfuscation, unauthorized data exfiltration, or suspicious execution patterns. While it requires storing credentials in a local JSON configuration file, this behavior is transparently documented in SKILL.md and is necessary for the tool's operation.
能力评估
Purpose & Capability
Name/description (Gmail -> Telegram alerts, star Gmail messages) matches the implementation: code connects to imap.gmail.com, logs in with an app password, searches UNSEEN messages, stars matches, and posts to the official Telegram API. No unrelated services or credentials are requested.
Instruction Scope
SKILL.md instructs creating a local config file with email/app password/telegram token/chat id and running the provided script. The code reads only that config path (~/.config/gmail_monitor/config.json), writes a seen_ids state file in the same directory, and does IMAP/HTTP calls appropriate to the task. It does not access other system paths, call arbitrary endpoints, or perform actions outside the stated scope.
Install Mechanism
There is no install spec and no downloads; the skill is instruction-only with a single Python stdlib script. Nothing is written to disk by an installer beyond the user-created config and the provided script.
Credentials
No platform environment variables are required (credentials are stored in a local config file), which is consistent with the SKILL.md. However, the skill requires sensitive secrets (Gmail app password and Telegram bot token/chat id) stored in plaintext in ~/.config/gmail_monitor/config.json — this is functionally necessary but has security implications the user should consider.
Persistence & Privilege
The skill does not request always:true and has no special platform privileges. Running it as a daemon or via cron is up to the user; the script maintains only its own seen-state file and does not modify other skill or system configurations.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gmail-lead-monitor
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gmail-lead-monitor 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
Slug gmail-lead-monitor
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Gmail Lead Monitor 是什么?

Monitor a Gmail inbox for new emails matching keywords and send real-time Telegram alerts while starring important messages in Gmail. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 141 次。

如何安装 Gmail Lead Monitor?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gmail-lead-monitor」即可一键安装,无需额外配置。

Gmail Lead Monitor 是免费的吗?

是的,Gmail Lead Monitor 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Gmail Lead Monitor 支持哪些平台?

Gmail Lead Monitor 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Gmail Lead Monitor?

由 Mike(@themsquared)开发并维护,当前版本 v1.0.0。

💬 留言讨论