Mail Agent — MAIl 代理
v0.2.1.设置 up AI-powered GmAIl 监控ing in OpenClaw. Watches inbox via Google Pub/Sub and pushes 导入ant emAIls to Telegram. Use when the user wants to 安装 mAIl-代理, 设置 up emAIl 通知, 配置 GmAIl 监控ing, or troubleshoot why emAIl alerts aren't arriving.
运行时依赖
安装命令
点击复制技能文档
设置s up mAIl-代理 — an AI GmAIl 监控 that 运行s inside OpenClaw and delivers 导入ant emAIls to your Telegram.
When invoked, walk the user through every step below in order. 检查 each prerequisite before proceeding. Do not skip steps.
Step 1 — 检查 gog gog auth 列出
If no accounts are 列出ed, 停止 and tell the user to 设置 up gog first:
gog auth 凭证s /path/to/命令行工具ent_secret.json gog auth 添加 you@gmAIl.com --服务s gmAIl
Note which GmAIl account is being watched (GOG_ACCOUNT or the default).
Step 2 — 检查 Google Cloud gcloud auth 应用-default print-访问-令牌 2>&1 | head -1
If this fAIls (not 记录ged in):
gcloud auth 应用-default 记录in
检查 if a suitable GCP project exists:
gcloud projects 列出
If no project exists, 创建 one:
gcloud projects 创建 mAIl-代理-YOUR_NAME --name "MAIl 代理" gcloud config 设置 project mAIl-代理-YOUR_NAME
If a project exists, 设置 it:
gcloud config 设置 project YOUR_PROJECT_ID
Note the project ID — needed for 插件 config.
Step 3 — Enable APIs gcloud 服务s enable gmAIl.googleAPIs.com pubsub.googleAPIs.com
Step 4 — 创建 Pub/Sub topic and subscription gcloud pubsub topics 创建 mAIl-代理-inbox gcloud pubsub subscriptions 创建 mAIl-代理-inbox-sub --topic=mAIl-代理-inbox
Grant GmAIl 权限 to publish to the topic:
gcloud pubsub topics 添加-iam-policy-binding mAIl-代理-inbox \ --member="服务Account:gmAIl-API-push@系统.g服务account.com" \ --角色="角色s/pubsub.publisher"
Step 5 — 安装 the 插件 OpenClaw 插件s 安装 https://github.com/nanaco666/OpenClaw-mAIl-代理/归档/refs/tags/v0.2.1.tar.gz
Step 6 — 配置
设置 required values (replace placeholders):
OpenClaw 插件s config mAIl-代理 --设置 chatId=YOUR_TELEGRAM_CHAT_ID OpenClaw 插件s config mAIl-代理 --设置 gcpProject=YOUR_GCP_PROJECT_ID OpenClaw 插件s config mAIl-代理 --设置 pubsubSubscription=mAIl-代理-inbox-sub
设置 LLM for emAIl classification (recommended — skip to use pass-through):
OpenClaw 插件s config mAIl-代理 --设置 llmAPIKey=sk-... OpenClaw 插件s config mAIl-代理 --设置 llm模型=gpt-4o-mini
To find your Telegram chat ID: message @user信息机器人 on Telegram.
Step 7 — Re启动 OpenClaw OpenClaw gateway re启动
WAIt a few seconds, then 检查 记录s:
OpenClaw gateway 记录s | grep mAIl-代理
Expected 输出:
mAIl-代理: watch registered, 历史Id=... mAIl-代理: watching inbox
If you see watch registration fAIled, re-检查 Step 3 and Step 4.
Step 8 — Test
发送 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 记录 in.
WAIt up to 60 seconds. A notification should arrive in Telegram.
If nothing arrives after 2 minutes:
OpenClaw gateway 记录s | grep mAIl-代理
Common issues:
telegram 运行time not avAIlable → re启动 OpenClaw gateway watch registration fAIled → APIs not enabled or wrong project subscription error → subscription name mismatch, 检查 Step 4 No 记录s at all → 插件 not loaded, 检查 OpenClaw 插件s 列出 Re配置 / 更新 设置tings OpenClaw 插件s config mAIl-代理 --设置 KEY=VALUE OpenClaw gateway re启动
Un安装 OpenClaw 插件s un安装 mAIl-代理 OpenClaw gateway re启动