返回顶部
g

gmail-enhancedGmail增强版

Enhanced Gmail integration with advanced features including label management, attachment handling, advanced search, email parsing, and automated email processing workflows.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
98
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

gmail-enhanced

Gmail增强版

具备强大自动化功能的高级Gmail集成。

功能特性

1. 高级搜索

  • - 复杂查询构建(AND、OR、NOT)
  • 日期范围筛选
  • 附件筛选
  • 标签筛选
  • 附件内容搜索

2. 标签管理

  • - 创建、重命名、删除标签
  • 嵌套标签(文件夹)
  • 颜色自定义
  • 标签统计

3. 附件处理

  • - 下载附件
  • 上传并发送附件
  • 按类型/大小筛选附件
  • 提取附件至云存储

4. 邮件处理

  • - 自动分类邮件
  • 从邮件中提取数据
  • 自动回复规则
  • 邮件模板
  • 退信检测

5. 邮件解析

  • - 提取结构化数据
  • 解析发票、收据
  • 提取联系人信息
  • HTML解析

前置条件

  1. 1. 在Google Cloud Console中启用Gmail API
  2. 创建OAuth 2.0凭据
  3. 下载credentials.json文件
  4. 生成tokens.json文件(通过身份验证运行一次)

配置

bash
export GMAILCREDENTIALSPATH=/path/to/credentials.json
export GMAILTOKENPATH=/path/to/tokens.json

或将凭据放置在默认位置:

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

使用方法

发送邮件

python from gmail_enhanced import GmailClient

gmail = GmailClient()

简单邮件

gmail.send( to=recipient@example.com, subject=你好, body=邮件内容 )

带附件

gmail.send( to=recipient@example.com, subject=报告, body=请查收附件中的报告, attachments=[report.pdf] )

高级搜索

python

复杂查询

results = gmail.search( query=from:boss@company.com, label=INBOX, after=2024/01/01, has_attachments=True )

使用OR搜索

results = gmail.search_or([ subject:紧急, label:重要 ])

标签管理

python

创建标签

label = gmail.create_label(项目/工作/Q1, color=#4A90E2)

获取标签统计

stats = gmail.getlabelstats(INBOX)

应用标签

gmail.addlabels([标签1, 标签2], messageids)

附件处理

python

从搜索结果下载附件

attachments = gmail.search_attachments( query=subject:发票, save_dir=./下载 )

上传附件

gmail.send( to=recipient@example.com, subject=文件, attachments=[/path/to/file.pdf] )

自动分类

python

创建规则

gmail.add_rule( name=分类发票, query=subject:发票 has:attachment, add_labels=[已处理/发票] )

运行规则

gmail.process_rules()

API参考

核心方法
方法描述
send(to, subject, body, attachments, cc, bcc)发送邮件
search(query, max_results, label)
搜索邮件 |

| getmessage(msgid, format) | 获取邮件详情 | | deletemessage(msgid) | 移至回收站 | | archivemessage(msgid) | 归档邮件 |

标签方法
方法描述
createlabel(name, color)创建标签
renamelabel(oldname, newname)
重命名标签 |

| delete_label(name) | 删除标签 | | get_labels() | 列出所有标签 | | getlabelstats(label) | 获取标签统计 |

附件方法
方法描述
downloadattachment(msgid, attachmentid, savepath)下载附件
searchattachments(query, savedir)
搜索并下载 |

| getattachmentinfo(msg_id) | 列出附件 |

自动化方法
方法描述
addrule(name, query, actions)创建处理规则
processrules()
运行所有规则 |

| create_template(name, subject, body) | 创建邮件模板 | | sendtemplate(templatename, to, variables) | 使用模板发送 |

解析方法
方法描述
parseemail(msgid)提取结构化数据
extractinvoice(msgid)
解析发票数据 |

| extractcontacts(msgid) | 提取邮箱地址 |

邮件查询语法

基本:
from:user@example.com
to:user@example.com
subject:关键词
精确短语

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

标记:
has:attachment
has:drive
is:unread
is:starred
is:important

标签:
label:INBOX
label:工作

组合:
from:老板 AND subject:紧急
(from:张三 OR from:李四) AND is:unread

错误处理

常见错误:

  • - invalidcredentials:重新进行身份验证
  • ratelimit:等待后重试
  • notfound:消息ID无效
  • permissiondenied:检查权限范围

所需权限范围

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

链接

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 gmail-enhanced-1776101042 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 gmail-enhanced-1776101042 技能

通过命令行安装

skillhub install gmail-enhanced-1776101042

下载

⬇ 下载 gmail-enhanced v1.0.0(免费)

文件大小: 7.76 KB | 发布时间: 2026-4-14 10:07

v1.0.0 最新 2026-4-14 10:07
- Initial release of gmail-enhanced with advanced Gmail integration.
- Features include label management, attachment handling, advanced search, email parsing, and automated email processing workflows.
- Supports robust search queries, auto-reply rules, template management, and structured data extraction.
- Provides comprehensive API methods for sending, searching, parsing, and managing emails, labels, and attachments.
- Includes detailed setup instructions and usage examples for streamlined configuration.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部