← 返回
未分类 Key 中文

Mail Agent

Set up AI-powered Gmail monitoring in OpenClaw. Watches inbox via Google Pub/Sub and pushes important emails to Telegram. Use when the user wants to install...
在 OpenClaw 中设置 AI 驱动的 Gmail 监控。通过 Google Pub/Sub 监控收件箱,并将重要邮件推送至 Telegram。适用于用户想要安装...
nanaco666
未分类 clawhub v0.1.3 1 版本 100000 Key: 需要
★ 0
Stars
📥 781
下载
💾 0
安装
1
版本
#latest

概述

Sets up mail-agent — an AI Gmail monitor that runs inside OpenClaw and delivers important emails to your Telegram.

When invoked, walk the user through every step below in order. Check each prerequisite before proceeding. Do not skip steps.


Step 1 — Check gog

gog auth list

If no accounts are listed, stop and tell the user to set up gog first:

gog auth credentials /path/to/client_secret.json
gog auth add you@gmail.com --services gmail

Note which Gmail account is being watched (GOG_ACCOUNT or the default).


Step 2 — Check Google Cloud

gcloud auth application-default print-access-token 2>&1 | head -1

If this fails (not logged in):

gcloud auth application-default login

Check if a suitable GCP project exists:

gcloud projects list

If no project exists, create one:

gcloud projects create mail-agent-YOUR_NAME --name "Mail Agent"
gcloud config set project mail-agent-YOUR_NAME

If a project exists, set it:

gcloud config set project YOUR_PROJECT_ID

Note the project ID — needed for plugin config.


Step 3 — Enable APIs

gcloud services enable gmail.googleapis.com pubsub.googleapis.com

Step 4 — Create Pub/Sub topic and subscription

gcloud pubsub topics create mail-agent-inbox
gcloud pubsub subscriptions create mail-agent-inbox-sub --topic=mail-agent-inbox

Grant Gmail permission to publish to the topic:

gcloud pubsub topics add-iam-policy-binding mail-agent-inbox \
  --member="serviceAccount:gmail-api-push@system.gserviceaccount.com" \
  --role="roles/pubsub.publisher"

Step 5 — Install the plugin

openclaw plugins install https://github.com/nanaco666/openclaw-mail-agent/archive/refs/tags/v0.2.1.tar.gz

Step 6 — Configure

Set required values (replace placeholders):

openclaw plugins config mail-agent --set chatId=YOUR_TELEGRAM_CHAT_ID
openclaw plugins config mail-agent --set gcpProject=YOUR_GCP_PROJECT_ID
openclaw plugins config mail-agent --set pubsubSubscription=mail-agent-inbox-sub

Set LLM for email classification (recommended — skip to use pass-through):

openclaw plugins config mail-agent --set llmApiKey=sk-...
openclaw plugins config mail-agent --set llmModel=gpt-4o-mini

To find your Telegram chat ID: message @userinfobot on Telegram.


Step 7 — Restart OpenClaw

openclaw gateway restart

Wait a few seconds, then check logs:

openclaw gateway logs | grep mail-agent

Expected output:

mail-agent: watch registered, historyId=...
mail-agent: watching inbox

If you see watch registration failed, re-check Step 3 and Step 4.


Step 8 — Test

Send a test email to the watched Gmail account with urgent content, e.g.:

> Subject: Urgent: server is down

> Body: Production database crashed, users can't log in.

Wait up to 60 seconds. A notification should arrive in Telegram.

If nothing arrives after 2 minutes:

openclaw gateway logs | grep mail-agent

Common issues:

  • telegram runtime not available → restart OpenClaw gateway
  • watch registration failed → APIs not enabled or wrong project
  • subscription error → subscription name mismatch, check Step 4
  • No logs at all → plugin not loaded, check openclaw plugins list

Reconfigure / update settings

openclaw plugins config mail-agent --set KEY=VALUE
openclaw gateway restart

Uninstall

openclaw plugins uninstall mail-agent
openclaw gateway restart

版本历史

共 1 个版本

  • v0.1.3 当前
    2026-03-30 20:38 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 712 📥 243,805
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,215 📥 266,517
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,136