← 返回
未分类 Key 中文

Gmail IMAP

Read, search, send, trash, move, and label Gmail via IMAP. Requires GMAIL_IMAP_USER (Gmail address) and GMAIL_IMAP_PASSWORD (Google App Password) environment...
使用 IMAP 读取、搜索、发送、删除、移动和标记 Gmail;需提供 GMAIL_IMAP_USER( Gmail 地址)和 GMAIL_IMAP_PASSWORD( Google 应用密码)环境变量。
scottgl9
未分类 clawhub v1.1.1 1 版本 100000 Key: 需要
★ 2
Stars
📥 368
下载
💾 0
安装
1
版本
#email#gmail#imap#latest#search#smtp

概述

Gmail IMAP Skill

All Gmail access uses IMAP. Credentials are read from environment variables — never printed.

Requirements

Set these environment variables before use:

VariableDescription
-----------------------
GMAIL_IMAP_USERYour Gmail address (e.g. user@gmail.com)
GMAIL_IMAP_PASSWORDA Google App Password (not your account password)

Generate an App Password at: https://myaccount.google.com/apppasswords (requires 2FA enabled)

Quick Reference

# Locate the script (adjust SKILL_DIR to match your install location):
# Default: ~/.openclaw/skills/gmail-imap
# Custom:  <workspace>/skills/gmail-imap
SCRIPT="$SKILL_DIR/scripts/gmail_imap.py"

# List inbox (most recent 20)
"$SCRIPT" list

# List with custom limit
"$SCRIPT" list --limit 50

# List unread only (shorthand)
"$SCRIPT" list --unread

# List unread with limit
"$SCRIPT" list --unread --limit 10

# Search by sender (IMAP header search)
"$SCRIPT" list --search 'FROM "boss@example.com"'

# Full-text search (Gmail X-GM-RAW — searches body + headers)
"$SCRIPT" search "invoice"
"$SCRIPT" search "from:boss@example.com is:unread" --limit 5
"$SCRIPT" search "subject:meeting this week"

# Read a message (by UID shown in list output)
"$SCRIPT" read <uid>

# Read from a specific folder
"$SCRIPT" read <uid> --folder "[Gmail]/All Mail"

# Delete (moves to [Gmail]/Trash — correct Gmail deletion)
"$SCRIPT" trash <uid>

# Move to a label/folder
"$SCRIPT" move <uid> "Work"

# Send email
"$SCRIPT" send --to recipient@example.com --subject "Hello" --body "Message text"

Deletion Rule (Critical)

Never use the standard IMAP \Deleted flag on Gmail — it only archives, it does not delete.

Always use trash which moves to [Gmail]/Trash. The script handles this correctly.

Credentials

Set in env (never output raw password):

  • GMAIL_IMAP_USER — Gmail address
  • GMAIL_IMAP_PASSWORD — App password (generate at myaccount.google.com/apppasswords)

Reference

For folder names, search syntax, direct Python IMAP usage, and connection details:

→ See references/gmail-imap-reference.md

版本历史

共 1 个版本

  • v1.1.1 当前
    2026-05-07 18:02 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

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

Skill Vetter

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

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358 📥 318,334