Gmail Lead Monitor

👤 themsquared 📦 v1.0.0 ⭐ 4.2 ⬇️ 806 下載
📈 商業運營 免費 🔑 需 API Key

📖 技能介紹

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

    小蔥技能7w4.net有完整的技能分類。

  • 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 << 'EOF'
{
  "email": "you@gmail.com",
  "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: john@company.com
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

🤖 AI 評測

這個 Skill 整體質量不錯,程式碼結構清晰、文件詳細、配置靈活,能可靠地監控 Gmail 併發送 Telegram 通知。零依賴的設計讓安裝很方便,狀態管理避免了重複告警。不足之處是告警功能比較基礎,主要靠關鍵詞匹配來識別重要郵件,沒有更智慧的過濾方式;另外程式執行狀態沒有持久化日誌,一旦出錯只能手動檢視。適合對郵件監控需求簡單、追求輕量化的使用者。

📊 多維度評分

適應性4
規範性4.1
有效性4.4
可靠性4.2
可信度4.3

📁 包含檔案 (4 個)

📄 SKILL.md 2.4 KB
📄 _meta.json 137 B
📄 gmail_monitor.py 11 KB
📄 skill-card.md 2.2 KB