Email Monitor

👤 qiusuo9809 📦 v1.0.0 ⭐ 4.4 ⬇️ 934 下載
📄 辦公效率 免費 🔑 需 API Key

📖 技能介紹


name: email-monitor description: > Set up periodic email monitoring for any IMAP mailbox (Gmail, Outlook, QQ, etc.). Guides users through mailbox configuration, tests the connection, then creates a scheduled cron task to check for new emails at user-defined intervals and deliver summaries in a custom format. Use when a user wants to automatically monitor an inbox for new messages, set up periodic email fetching or summarization, or configure email alerts and digests on a schedule.


Email Monitor Skill

This skill guides the user through a 6-step onboarding to set up automated email monitoring.

Onboarding Flow

Work through these steps in order, one step per conversation turn. Do not skip ahead.

Step 1 — Ask which mailbox to monitor

Ask the user:

"請告訴我你想監控的郵箱地址是什麼?(例如 yourname@gmail.com)"

Step 2 — Provide provider-specific setup guidance

Based on the email domain, read references/imap-setup.md and show the user the relevant setup instructions: - @gmail.com → Gmail IMAP + App Password guide - @outlook.com / @hotmail.com → Outlook section - @qq.com → QQ Mail section - Others → Generic IMAP section

Ask the user to provide: - Their email address - Their app password (or account password for non-Gmail)

Store these in a local config file: ~/.openclaw/email-monitor/<sanitized-email>/config.json

Config template:

{
  "email": "<email>",
  "password": "<password>",
  "imap_host": "<host>",
  "imap_port": 993,
  "mailbox": "INBOX",
  "state_file": "~/.openclaw/email-monitor/<sanitized-email>/state.json",
  "max_emails": 20,
  "fetch_attachments": false,
  "attachment_dir": "~/Downloads/email-attachments"
}

Step 3 — Test connection

Run the fetch script once to verify credentials and connectivity:

python3 <skill_dir>/scripts/fetch_emails.py --config ~/.openclaw/email-monitor/<sanitized-email>/config.json
  • Success: Show the user a sample of fetched emails (first 3), confirm "連線成功!"
  • Failure: Show the error message, help the user troubleshoot (wrong password, IMAP not enabled, etc.)

    7w4.net小蔥技能。

Only proceed to Step 4 after a successful test.

Step 4 — Ask for polling interval

Ask:

"連線成功!你希望每隔多久檢查一次新郵件?(例如:每1小時、每2小時、每天早上8點)"

Parse the user's answer into a valid cron expression. Examples: - "每小時" → 0 * * * * - "每2小時" → 0 */2 * * * - "每天早上8點" → 0 8 * * * - "每4小時" → 0 */4 * * *

Step 5 — Ask for notification format and attachment handling

Ask two questions in one message:

訊息格式:新郵件通知時,你希望看到哪些資訊? - A) 簡潔版:發件人 + 主題 + 日期 - B) 標準版:發件人 + 主題 + 日期 + 摘要(前200字) - C) 自定義(請描述)

附件:是否需要下載附件?如果需要,儲存到哪個目錄?

Update config.json with fetch_attachments and attachment_dir based on the response.

Store the notification format preference as notify_format in config.json: - "brief" for A - "standard" for B
- "<custom template string>" for C

Step 6 — Summarize and create cron job

Show a confirmation summary:

📧 郵件監控配置確認

郵箱:<email>
檢查頻率:每 X 小時(cron: <expr>)
通知格式:<format>
下載附件:<yes/no>(儲存至:<dir>)

確認後將建立定時任務。確認嗎?(是/否)

After user confirms, create the cron job using openclaw:

openclaw cron add "<cron-expr>" "檢查郵件 <email>" --run "python3 <skill_dir>/scripts/fetch_emails.py --config ~/.openclaw/email-monitor/<email>/config.json"

Then confirm to the user that the cron task is active.


Running Manually

At any time the user can say "現在檢查一下郵件" or similar — run the fetch script and display results using the configured format.

Format Templates

brief:

📩 [<date>] <from> — <subject>

standard:

📩 <subject>
👤 <from>
📅 <date>
---
<snippet>

Config File Location

Always store per-account config at: ~/.openclaw/email-monitor/<sanitized-email>/config.json

Where <sanitized-email> = email address with @ replaced by _at_ and . replaced by _. Example: qiusuo9809_at_gmail_com

State File

The state file tracks the last fetched UID to avoid re-sending old emails. It is auto-managed by scripts/fetch_emails.py. If the user wants to re-fetch all emails, delete the state file.

🤖 AI 評測

這個Skill做得不錯,能幫你自動盯著郵箱有新郵件就通知你,支援多種常見郵箱設定起來也很簡單。最貼心的是沒有新郵件時不會浪費任何費用。缺點是密碼會直接儲存在檔案裡,用起來有點擔心安全問題。總體來說質量值得信任,功能實用,但密碼儲存方式希望以後能改進。

📊 多維度評分

適應性4.5
規範性4.4
有效性4.6
可靠性3.9
可信度4.8

📁 包含檔案 (6 個)

📄 README.md 2.5 KB
📄 SKILL.md 4.5 KB
📄 _meta.json 139 B
📄 references/imap-setup.md 1.1 KB
📄 scripts/fetch_emails.py 5.2 KB
📄 skill-card.md 2.4 KB