Gmail Pub/Sub -> OpenClaw
目标:Gmail watch -> Pub/Sub 推送 -> gog gmail watch serve -> OpenClaw webhook。 前置条件 已安装并登录 gcloud(安装指南)。 已安装 gog (gogcli) 并为 Gmail 账户授权(gogcli.sh)。 已启用 OpenClaw hooks(参见 Webhooks)。 已登录 tailscale(tailscale.com)。支持的设置使用 Tailscale Funnel 作为公共 HTTPS 端点。 其他隧道服务也可以使用,但需要自行配置/不受支持,需要手动接入。 目前,我们支持的是 Tailscale。 示例 hook 配置(启用 Gmail 预设映射): { hooks: { enabled: true, token: "OPENCLAW_HOOK_TOKEN", path: "/hooks", presets: ["gmail"], }, } 要将 Gmail 摘要投递到聊天界面,请用设置了 deliver 以及可选的 channel/to 的映射覆盖预设: { hooks: { enabled: true, token: "OPENCLAW_HOOK_TOKEN", presets: ["gmail"], mappings: [ { match: { path: "gmail" }, action: "agent", wakeMode: "now", name: "Gmail", sessionKey: "hook:gmail:{{messages[0].id}}", messageTemplate: "New email from {{messages[0].from}}\nSubject: {{messages[0].subject}}\n{{messages[0].snippet}}\n{{messages[0].body}}", model: "openai/gpt-5.2-mini", deliver: true, channel: "last", // to: "+15551234567" }, ], }, } 如果你想使用固定渠道,请设置 channel + to。否则 channel: "last" 会使用上次的投递路由(默认回退到 WhatsApp)。 ...