gmail-inbox
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGmail Inbox Management
Gmail收件箱管理
Goal
目标
Check and manage emails across multiple Gmail accounts using unified tooling.
借助统一工具检查并管理多个Gmail账户的邮件。
Scripts
脚本
- - Check and manage inboxes
./scripts/gmail_unified.py - - Authenticate accounts
./scripts/gmail_multi_auth.py - - Bulk labeling
./scripts/gmail_bulk_label.py - - Create filters
./scripts/gmail_create_filters.py - - Auth helper
./scripts/gmail_auth.py
- - 检查并管理收件箱
./scripts/gmail_unified.py - - 账户认证
./scripts/gmail_multi_auth.py - - 批量标记标签
./scripts/gmail_bulk_label.py - - 创建筛选规则
./scripts/gmail_create_filters.py - - 认证辅助工具
./scripts/gmail_auth.py
Quick Reference
快速参考
bash
undefinedbash
undefinedCheck unread across all accounts
查看所有账户的未读邮件
python3 ./scripts/gmail_unified.py --query "is:unread" --limit 50
python3 ./scripts/gmail_unified.py --query "is:unread" --limit 50
Check specific account only
仅查看特定账户
python3 ./scripts/gmail_unified.py --query "is:unread" --account yourcompany
python3 ./scripts/gmail_unified.py --query "is:unread" --account yourcompany
List registered accounts
列出已注册账户
python3 ./scripts/gmail_unified.py --accounts
python3 ./scripts/gmail_unified.py --accounts
Label and archive emails
标记标签并归档邮件
python3 ./scripts/gmail_unified.py --query "from:notifications@" --label "Notifications" --archive
python3 ./scripts/gmail_unified.py --query "from:notifications@" --label "Notifications" --archive
Mark as read
标记为已读
python3 ./scripts/gmail_unified.py --query "from:noreply@" --mark-read
python3 ./scripts/gmail_unified.py --query "from:noreply@" --mark-read
Dry run (preview)
试运行(预览)
python3 ./scripts/gmail_unified.py --query "subject:invoice" --label "Invoices" --dry-run
undefinedpython3 ./scripts/gmail_unified.py --query "subject:invoice" --label "Invoices" --dry-run
undefinedAccount Registry
账户注册表
| Account | Credentials | Token | |
|---|---|---|---|
| youruser | you@example.com | credentials.json | token_youruser.json |
| yourcompany | you@yourdomain.com | credentials_yourcompany.json | token_yourcompany.json |
| 账户名称 | 邮箱 | 凭证文件 | 令牌文件 |
|---|---|---|---|
| youruser | you@example.com | credentials.json | token_youruser.json |
| yourcompany | you@yourdomain.com | credentials_yourcompany.json | token_yourcompany.json |
Troubleshooting Auth Errors
认证错误排查
"Token file not found"
bash
python3 ./scripts/gmail_multi_auth.py --account yourcompany --email you@yourdomain.com"invalid_scope: Bad Request"
bash
rm token_youruser.json
python3 ./scripts/gmail_multi_auth.py --account youruser --email you@example.com"Failed to authenticate"
Check that credentials.json exists in root directory.
"Token file not found"(未找到令牌文件)
bash
python3 ./scripts/gmail_multi_auth.py --account yourcompany --email you@yourdomain.com"invalid_scope: Bad Request"(无效权限范围:请求错误)
bash
rm token_youruser.json
python3 ./scripts/gmail_multi_auth.py --account youruser --email you@example.com"Failed to authenticate"(认证失败)
确认根目录下存在credentials.json文件。
Required Scopes
所需权限范围
- - Read/write emails
gmail.modify - - Create/manage labels
gmail.labels - - Manage settings
gmail.settings.basic - - Google Sheets access
spreadsheets - - Google Drive access
drive
- - 读写邮件
gmail.modify - - 创建/管理标签
gmail.labels - - 管理设置
gmail.settings.basic - - Google Sheets访问权限
spreadsheets - - Google Drive访问权限
drive
Credentials Location
凭证文件位置
All credential files should be in the workspace root:
- /
credentials.json- OAuth client configscredentials_yourcompany.json - - Auth tokens (auto-generated)
token_*.json - - Account registry
gmail_accounts.json
所有凭证文件应存放在工作区根目录:
- /
credentials.json- OAuth客户端配置文件credentials_yourcompany.json - - 认证令牌(自动生成)
token_*.json - - 账户注册表
gmail_accounts.json
Schema
架构
Inputs
输入参数
| Name | Type | Required | Description |
|---|---|---|---|
| string | No | Gmail search query (e.g., 'is:unread') |
| string | No | Specific account name from registry |
| integer | No | Max emails to fetch (default: 50) |
| 名称 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| 字符串 | 否 | Gmail搜索查询语句(例如:'is:unread') |
| 字符串 | 否 | 注册表中的特定账户名称 |
| 整数 | 否 | 最大获取邮件数(默认值:50) |
Outputs
输出参数
| Name | Type | Description |
|---|---|---|
| array | List of email objects with subject, from, date, snippet |
| 名称 | 类型 | 描述 |
|---|---|---|
| 数组 | 包含主题、发件人、日期、摘要的邮件对象列表 |
Credentials
凭证
| Name | Source |
|---|---|
| file |
| file (auto-generated) |
| 名称 | 来源 |
|---|---|
| 文件 |
| 文件(自动生成) |
Composable With
可组合技能
Skills that chain well with this one: ,
gmail-labelinstantly-autoreply与此技能适配性良好的技能:,
gmail-labelinstantly-autoreplyCost
成本
Free (Gmail API)
免费(基于Gmail API)