← 返回 Skills 市场
scottgl9

Gmail IMAP

作者 scottgl9 · GitHub ↗ · v1.1.1 · MIT-0
cross-platform ✓ 安全检测通过
67
总下载
2
收藏
0
当前安装
8
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (SKILL.md)

Gmail IMAP Skill

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

Requirements

Set these environment variables before use:

Variable Description
GMAIL_IMAP_USER Your Gmail address (e.g. [email protected])
GMAIL_IMAP_PASSWORD A 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:  \x3Cworkspace>/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 "[email protected]"'

# Full-text search (Gmail X-GM-RAW — searches body + headers)
"$SCRIPT" search "invoice"
"$SCRIPT" search "from:[email protected] is:unread" --limit 5
"$SCRIPT" search "subject:meeting this week"

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

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

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

# Move to a label/folder
"$SCRIPT" move \x3Cuid> "Work"

# Send email
"$SCRIPT" send --to [email protected] --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 \x3Cuid> 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

安全使用建议
This skill appears coherent and implements Gmail access using IMAP/SMTP as described. Before installing: (1) provide a dedicated Google App Password (not your main password) and enable 2FA; (2) prefer creating a separate app password for this skill so you can revoke it later; (3) review the included script yourself if you want to verify it won’t log or transmit credentials (the script does not print the password, but it will connect to Google servers and thus has access to your mail); (4) be aware that the agent can access and modify your email (read/delete/send) when invoked — only enable/use the skill for trusted agents and consider revoking the app password when no longer needed. If you want deeper assurance, provide the full (untruncated) script for a line-by-line review or run it in a controlled environment first.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
Name/description ask for Gmail IMAP access and the skill only requires GMAIL_IMAP_USER and GMAIL_IMAP_PASSWORD. The script uses imap.gmail.com and smtp.gmail.com and implements listing, searching, reading, trashing, moving, labeling, and sending — all consistent with the description.
Instruction Scope
SKILL.md instructs the agent to run the included script and to set the two environment variables. The instructions and script operate on IMAP/SMTP only and don't instruct reading unrelated files, contacting other endpoints, or exfiltrating data to third-party servers.
Install Mechanism
No install spec is provided (instruction-only). The skill ships a Python script that uses only standard libraries (imaplib, smtplib, email). No external downloads or package installs are requested.
Credentials
The skill requires exactly two environment variables: an email address and a Google App Password (declared as the primary credential). Those are proportionate and necessary for IMAP/SMTP access. No unrelated secrets or config paths are requested.
Persistence & Privilege
always is false and disable-model-invocation is false (normal). The skill does not request system-wide config changes or persist credentials beyond using the provided env vars at runtime.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gmail-imap
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gmail-imap 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.1
Fix: search results table now displays correctly (was using fetch instead of uid FETCH for UID-based search results). Fix: folder names with spaces/brackets (e.g. [Gmail]/All Mail) now properly quoted for IMAP.
v1.1.0
Add: search subcommand with full-text Gmail X-GM-RAW support (searches body+headers using Gmail's own search syntax). Add --unread shorthand to list. Add --limit to search. Add --folder to read and trash. Fix: print_message_list shared helper, empty result handling.
v1.0.5
Make script directly executable (#!/usr/bin/env python3 shebang); invoke as $SCRIPT list instead of python3 $SCRIPT list. Allows adding script path to exec approvals without needing python3 approval.
v1.0.4
Add metadata.openclaw with requires.env (GMAIL_IMAP_USER, GMAIL_IMAP_PASSWORD), primaryEnv, bins, and homepage to fix scanner flag.
v1.0.3
Add README.md with author credit (Scott Glover), usage examples, and license.
v1.0.2
Fix: use $SKILL_DIR variable instead of hardcoded absolute path to script; portable across install locations.
v1.0.1
Fix: move credential requirements (GMAIL_IMAP_USER, GMAIL_IMAP_PASSWORD) to top of description and add prominent Requirements section to resolve scanner warning.
v1.0.0
Initial publish — Gmail IMAP helper for OpenClaw agents. Read, search, send, trash, move, and label Gmail messages via IMAP. Credentials via GMAIL_IMAP_USER and GMAIL_IMAP_PASSWORD env vars.
元数据
Slug gmail-imap
版本 1.1.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 8
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 67 次。

如何安装 Gmail IMAP?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gmail-imap」即可一键安装,无需额外配置。

Gmail IMAP 是免费的吗?

是的,Gmail IMAP 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Gmail IMAP 支持哪些平台?

Gmail IMAP 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Gmail IMAP?

由 scottgl9(@scottgl9)开发并维护,当前版本 v1.1.1。

💬 留言讨论