安全扫描
OpenClaw
安全
high confidenceNULL
评估建议
该技能安全风险较低。
1. **认证机制**:使用托管 OAuth 认证,通过 Maton 网关代理 Microsoft Graph API 请求。所有请求需要有效的 MATON_API_KEY,无需在技能中管理敏感的 OAuth 凭据。
2. **数据访问**:技能可读取和发送邮件、日历事件、联系人和文件夹数据。这些是标准的 Microsoft 365 数据操作,属于日常工作场景。
3. **网络请求**:技能通过 Maton 网关(gateway.maton.ai)代理到 Microsoft Graph API(graph.microsoft.com)。确认 Maton 网关的隐私政策和数据处理方式。
4. **连接管理**:OAuth 连接通过 Maton 控制台(ctrl.maton.ai)管理,用户可随时撤销授权。
5. **权限控制**:Microsoft Graph 权限范围明确(邮件、日历、联系人),不会获取超出所需的数据。
**安装前建议**:
- 确认 Maton 服务的隐私政策
- 定期检查已授权的 OAuth 连接,及时撤销不再使用的授权
- 邮件和...详细分析 ▾
✓ 用途与能力
技能通过 Maton 网关向 Microsoft Graph API 发起外部请求
✓ 指令范围
通过 Maton 托管的 OAuth 机制进行 Microsoft Graph 认证
✓ 安装机制
可读取和发送用户邮箱中的邮件
✓ 凭证需求
可读取和修改用户的日历事件
ℹ 持久化与权限
可读取和管理用户的联系人信息
安全有层次,运行前请审查代码。
运行时依赖
无特殊依赖
版本
latestv1.0.32026/2/3
NULL
● 无害
安装命令
点击复制官方npx clawhub@latest install outlook-api
镜像加速npx clawhub@latest install outlook-api --registry https://cn.longxiaskill.com 镜像可用
本土化适配说明
Outlook — Outlook 集成 安装说明: 安装命令:npx clawhub@latest install outlook-api 支持国内镜像加速,使用 --registry https://cn.longxiaskill.com 参数可加速下载
技能文档
通过托管 OAuth 认证访问 Microsoft Outlook API(通过 Microsoft Graph)。读取、发送和管理邮件、文件夹、日历事件和联系人。
快速开始
# 获取用户资料
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/outlook/v1.0/me')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
基础 URL
https://gateway.maton.ai/outlook/{原生API路径}
将 {原生API路径} 替换为实际的 Microsoft Graph API 端点路径。网关将请求代理到 graph.microsoft.com 并自动注入您的 OAuth 令牌。
认证
所有请求都需要在 Authorization 头中携带 Maton API 密钥:
Authorization: Bearer $MATON_API_KEY
环境变量: 将您的 API 密钥设置为 MATON_API_KEY:
export MATON_API_KEY="您的API密钥"
获取 API 密钥
- 在 maton.ai 注册或登录账户
- 进入 maton.ai/settings
- 复制您的 API 密钥
连接管理
在 https://ctrl.maton.ai 管理您的 Microsoft OAuth 连接。
列出连接
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://ctrl.maton.ai/connections?app=outlook&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
添加新连接
python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'outlook'}).encode()
req = urllib.request.Request('https://ctrl.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
resp = json.load(urllib.request.urlopen(req))
print(f"请在浏览器中打开以下链接授权:\n{resp['auth_url']}")
EOF
邮件操作
读取邮件
python <<'EOF'
import urllib.request, os, json
# 获取邮件列表
req = urllib.request.Request('https://gateway.maton.ai/outlook/v1.0/me/messages?$top=10&$select=id,subject,from,receivedDateTime')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
发送邮件
python <<'EOF'
import urllib.request, os, json
data = json.dumps({
'message': {
'subject': '测试邮件',
'body': {'contentType': 'Text', 'content': '这是一封测试邮件。'},
'toRecipients': [{'emailAddress': {'address': '收件人@example.com'}}]
},
'saveToSentItems': 'true'
}).encode()
req = urllib.request.Request('https://gateway.maton.ai/outlook/v1.0/me/sendMail', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req))))
EOF
日历操作
获取日历事件
python <<'EOF'
import urllib.request, os, json
from datetime import datetime, timedelta
start = (datetime.now() - timedelta(days=7)).isoformat()
end = (datetime.now() + timedelta(days=30)).isoformat()
req = urllib.request.Request(f'https://gateway.maton.ai/outlook/v1.0/me/calendarView?startDateTime={start}&endDateTime={end}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
创建日历事件
python <<'EOF'
import urllib.request, os, json
from datetime import datetime, timedelta
start = (datetime.now() + timedelta(hours=1)).isoformat()
end = (datetime.now() + timedelta(hours=2)).isoformat()
data = json.dumps({
'subject': '团队会议',
'start': {'dateTime': start, 'timeZone': 'Asia/Shanghai'},
'end': {'dateTime': end, 'timeZone': 'Asia/Shanghai'},
'attendees': [{'emailAddress': {'address': '参会者@example.com'}, 'type': 'required'}]
}).encode()
req = urllib.request.Request('https://gateway.maton.ai/outlook/v1.0/me/events', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req))))
EOF
联系人操作
获取联系人列表
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/outlook/v1.0/me/contacts?$top=20&$select=id,displayName,emailAddresses')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
文件夹操作
列出邮件文件夹
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/outlook/v1.0/me/mailFolders')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
错误处理
常见错误码:
| 状态码 | 说明 | 解决方案 |
|---|---|---|
| 401 | API 密钥无效或过期 | 检查 MATON_API_KEY 环境变量 |
| 403 | 权限不足 | 确保 OAuth 连接已授权所需权限 |
| 404 | 资源不存在 | 检查请求的邮件/事件 ID 是否正确 |
| 429 | 请求频率超限 | 降低请求频率,添加适当延迟 |
权限范围
该技能使用以下 Microsoft Graph 权限:
Mail.Read- 读取邮件Mail.Send- 发送邮件Calendars.ReadWrite- 读写日历Contacts.ReadWrite- 读写联系人User.Read- 读取用户资料