← 返回 Skills 市场
jason-aka-chen

Gmail Enhanced

作者 jason-aka-chen · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
96
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gmail-enhanced-chen
功能描述
Enhanced Gmail integration with advanced features including label management, attachment handling, advanced search, email parsing, and automated email proces...
使用说明 (SKILL.md)

Gmail Enhanced

Advanced Gmail integration with powerful automation features.

Features

1. Advanced Search

  • Complex query building (AND, OR, NOT)
  • Date range filters
  • Attachment filters
  • Label filters
  • Search within attachments

2. Label Management

  • Create, rename, delete labels
  • Nested labels (folders)
  • Color customization
  • Label statistics

3. Attachment Handling

  • Download attachments
  • Upload and send attachments
  • Filter attachments by type/size
  • Extract attachments to cloud storage

4. Email Processing

  • Auto-categorize emails
  • Extract data from emails
  • Auto-reply rules
  • Email templates
  • Bounce detection

5. Email Parsing

  • Extract structured data
  • Parse invoices, receipts
  • Extract contact info
  • HTML parsing

Prerequisites

  1. Enable Gmail API in Google Cloud Console
  2. Create OAuth 2.0 credentials
  3. Download credentials.json
  4. Generate tokens.json (run once with authentication)

Configuration

export GMAIL_CREDENTIALS_PATH="/path/to/credentials.json"
export GMAIL_TOKEN_PATH="/path/to/tokens.json"

Or place credentials in default locations:

  • ~/.credentials/gmail-credentials.json
  • ~/.credentials/gmail-token.json

Usage

Send Email

from gmail_enhanced import GmailClient

gmail = GmailClient()

# Simple email
gmail.send(
    to="[email protected]",
    subject="Hello",
    body="Email content"
)

# With attachment
gmail.send(
    to="[email protected]",
    subject="Report",
    body="Please find the report attached",
    attachments=["report.pdf"]
)

Advanced Search

# Complex queries
results = gmail.search(
    query="from:[email protected]",
    label="INBOX",
    after="2024/01/01",
    has_attachments=True
)

# Search with OR
results = gmail.search_or([
    "subject:urgent",
    "label:important"
])

Label Management

# Create label
label = gmail.create_label("Projects/Work/Q1", color="#4A90E2")

# Get label stats
stats = gmail.get_label_stats("INBOX")

# Apply labels
gmail.add_labels(["Label1", "Label2"], message_ids)

Attachment Handling

# Download attachments from search results
attachments = gmail.search_attachments(
    query="subject:invoice",
    save_dir="./downloads"
)

# Upload attachment
gmail.send(
    to="[email protected]",
    subject="File",
    attachments=["/path/to/file.pdf"]
)

Auto-categorization

# Create rule
gmail.add_rule(
    name="Categorize invoices",
    query="subject:invoice has:attachment",
    add_labels=["Processed/Invoices"]
)

# Run rules
gmail.process_rules()

API Reference

Core Methods

Method Description
send(to, subject, body, attachments, cc, bcc) Send email
search(query, max_results, label) Search emails
get_message(msg_id, format) Get email details
delete_message(msg_id) Move to trash
archive_message(msg_id) Archive email

Label Methods

Method Description
create_label(name, color) Create label
rename_label(old_name, new_name) Rename label
delete_label(name) Delete label
get_labels() List all labels
get_label_stats(label) Get label statistics

Attachment Methods

Method Description
download_attachment(msg_id, attachment_id, save_path) Download attachment
search_attachments(query, save_dir) Search and download
get_attachment_info(msg_id) List attachments

Automation Methods

Method Description
add_rule(name, query, actions) Create processing rule
process_rules() Run all rules
create_template(name, subject, body) Create email template
send_template(template_name, to, variables) Send using template

Parsing Methods

Method Description
parse_email(msg_id) Extract structured data
extract_invoice(msg_id) Parse invoice data
extract_contacts(msg_id) Extract email addresses

Email Query Syntax

Basic:
  from:[email protected]
  to:[email protected]
  subject:keyword
  "exact phrase"

Filters:
  after:2024/01/01
  before:2024/12/31
  older_than:7d
  newer_than:2h

Flags:
  has:attachment
  has:drive
  is:unread
  is:starred
  is:important

Labels:
  label:INBOX
  label:Work

Combinations:
  from:boss AND subject:urgent
  (from:alice OR from:bob) AND is:unread

Error Handling

Common errors:

  • invalid_credentials: Re-authenticate
  • rate_limit: Wait and retry
  • not_found: Message ID invalid
  • permission_denied: Check scopes

Scopes Required

https://www.googleapis.com/auth/gmail.readonly
https://www.googleapis.com/auth/gmail.send
https://www.googleapis.com/auth/gmail.labels
https://www.googleapis.com/auth/gmail.modify

Links

安全使用建议
This skill appears to do what it says: it uses the Gmail API and requires OAuth client credentials and a user token file. Before installing, consider: (1) OAuth scopes requested include send/modify — installing grants broad mailbox access, so use a dedicated/test account if you want to limit risk; (2) the skill will write tokens.json to the configured path, so protect that file; (3) the package is third‑party and not from a known homepage — review the full source (particularly the parts truncated in this listing), run it in a sandbox, and verify there are no hidden network endpoints; (4) the code contains at least one minor bug/typo in the color mapping (an undefined variable), indicating it may be untested — expect possible runtime errors and consider reviewing or testing before using on production mailboxes.
功能分析
Type: OpenClaw Skill Name: gmail-enhanced-chen Version: 1.0.0 The skill provides extensive Gmail management capabilities but contains a path traversal vulnerability in the `search_attachments` method within `gmail_enhanced.py`. Specifically, it uses `os.path.join` with unsanitized attachment filenames provided by the Gmail API, which could allow a remote email sender to overwrite arbitrary files on the agent's local filesystem. While the functionality aligns with the stated purpose, the lack of input validation on filenames and the requirement for broad OAuth scopes (including `gmail.send` and `gmail.modify`) present a significant security risk.
能力评估
Purpose & Capability
Name, description, SKILL.md, and the included python implementation all focus on Gmail operations (search, labels, attachments, send, parsing). Required inputs (OAuth client credentials file and token file) are appropriate for Gmail API access. Note: registry metadata lists no required env vars, while SKILL.md and the code expect GMAIL_CREDENTIALS_PATH / GMAIL_TOKEN_PATH or default files under ~/.credentials — this is a minor metadata mismatch but functionally coherent.
Instruction Scope
SKILL.md instructs the agent to enable Gmail API, create OAuth credentials, and place credentials/token files locally — all within the scope of Gmail integration. The runtime instructions and code confine operations to Gmail APIs and local file paths for credentials/attachments. There are no instructions to read unrelated system files, call external endpoints beyond Google APIs, or exfiltrate data to unknown hosts.
Install Mechanism
No install spec — instruction-only skill with an included Python module. That minimizes install-time risk (nothing downloaded automatically). The code depends on standard google-auth/googleapiclient libraries, which the SKILL.md links to indirectly by describing OAuth setup. No remote or obfuscated install URLs were used.
Credentials
The skill legitimately requires OAuth credentials (client secrets + generated user tokens). Those are sensitive because the declared SCOPES include gmail.readonly, gmail.send, gmail.labels, and gmail.modify (read/write/modify access to the mailbox). This level of access is proportionate for a full-featured Gmail client, but users must understand granting these scopes gives the skill broad mailbox permissions. Also note the registry metadata did not declare required env vars even though SKILL.md/code reference them.
Persistence & Privilege
always is false and default agent invocation behavior is preserved. The skill writes its own token file when authenticating (expected for OAuth) but does not request system-wide configuration changes or other skills' credentials. No permanent elevated presence is requested.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gmail-enhanced-chen
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gmail-enhanced-chen 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Gmail Enhanced 1.0.0 introduces robust automation and advanced management features for Gmail: - Advanced email search with complex queries, date/label/attachment filters, and search within attachments. - Comprehensive label management including creation, nesting, renaming, deletion, color customization, and statistics. - Enhanced attachment handling: downloading, uploading, filtering, and extraction to cloud storage. - Automated email processing: auto-categorization, data extraction, auto-reply, templates, and bounce detection. - Powerful email parsing for structured data, invoices, receipts, and contact info. - Easy configuration, detailed API reference, and usage examples provided.
元数据
Slug gmail-enhanced-chen
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Gmail Enhanced 是什么?

Enhanced Gmail integration with advanced features including label management, attachment handling, advanced search, email parsing, and automated email proces... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 96 次。

如何安装 Gmail Enhanced?

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

Gmail Enhanced 是免费的吗?

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

Gmail Enhanced 支持哪些平台?

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

谁开发了 Gmail Enhanced?

由 jason-aka-chen(@jason-aka-chen)开发并维护,当前版本 v1.0.0。

💬 留言讨论