Gmail IMAP

v1.1.1

Read, search, send, trash, move, and label Gmail via IMAP. Requires GMAIL_IMAP_USER (Gmail address) and GMAIL_IMAP_PASSWORD (Google App Password) environment...

2· 51·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for scottgl9/gmail-imap.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Gmail IMAP" (scottgl9/gmail-imap) from ClawHub.
Skill page: https://clawhub.ai/scottgl9/gmail-imap
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required env vars: GMAIL_IMAP_USER, GMAIL_IMAP_PASSWORD
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install gmail-imap

ClawHub CLI

Package manager switcher

npx clawhub@latest install gmail-imap
Security Scan
Capability signals
Requires sensitive credentials
These labels describe what authority the skill may exercise. They are separate from suspicious or malicious moderation verdicts.
VirusTotalVirusTotal
Pending
View report →
OpenClawOpenClaw
Benign
high confidence
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.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

EnvGMAIL_IMAP_USER, GMAIL_IMAP_PASSWORD
Primary envGMAIL_IMAP_PASSWORD
emailvk979ny46b258ptxcdqrb046ec985myv1gmailvk979ny46b258ptxcdqrb046ec985myv1imapvk979ny46b258ptxcdqrb046ec985myv1latestvk979ny46b258ptxcdqrb046ec985myv1searchvk979ny46b258ptxcdqrb046ec985myv1smtpvk979ny46b258ptxcdqrb046ec985myv1
51downloads
2stars
8versions
Updated 1d ago
v1.1.1
MIT-0

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 <uid> 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

Comments

Loading comments...