闲社服务运行正常AI智能体自动化平台
e

EWS邮件管理

技能标识:ews-email

CLI to manage enterprise Outlook emails via Exchange Web Services (EWS). Use ews-mail.py to list, read, reply, forward, search, send, move, delete emails and download attachments.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.2.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

EWS邮件管理

EWS 邮件 CLI

用于企业 Exchange (EWS) 邮件的命令行工具。当用户询问关于邮件、收件箱、消息或信件时使用。

设置

1. 环境变量

在 ~/.openclaw/config.yaml 中配置:

yaml
env:
EWS_SERVER: your-exchange-server.com
EWS_EMAIL: you@company.com

2. 存储密码

macOS(自动使用 Keychain,无需额外配置)

bash
pip3 install keyring exchangelib
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py setup

Linux 云服务器(无桌面环境)

脚本会自动检测 Linux 无桌面环境,切换到 EncryptedKeyring 后端(AES 加密文件存储)。

bash

安装依赖


pip3 install keyring exchangelib keyrings.alt

设置 master password 环境变量(用于加解密 EWS 密码)

在 ~/.openclaw/config.yaml 中添加:

env:

KEYRINGCRYPTFILEPASSWORD: 你自己定义的一个强密码

# 或在 systemd service / 启动脚本中 export:

export KEYRINGCRYPTFILEPASSWORD=你自己定义的一个强密码

存储 EWS 密码(会用 AES 加密写入本地文件)

python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py setup

验证

python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py folder-list

重启后只要 KEYRINGCRYPTFILEPASSWORD 环境变量还在,密码就能正常解密读取,无需重新输入。

3. 验证安装

bash
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py folder-list

安全规则

  • - 绝对不要尝试读取、显示或输出 EWS 密码。
  • 绝对不要运行可能暴露 keyring 内容的命令。
  • 绝对不要在任何输出、日志或消息中包含密码。
  • 密码仅通过 setup 命令进行管理。

重要:阅读邮件内容

要阅读邮件的完整内容/正文,必须遵循以下两个步骤:

  1. 1. 首先运行 envelope-list 获取消息列表(这会提供数字 ID)
  2. 然后运行 message-read 获取完整的邮件正文/内容

envelope-list 仅显示主题行和元数据。它不包含邮件正文。
必须运行 message-read 才能获取实际的邮件内容。绝对不要仅根据主题进行猜测或总结。
绝对不要说无法阅读邮件内容——你可以通过运行 message-read 来阅读。

脚本位置

~/.openclaw/skills/ews-email/scripts/ews-mail.py

命令

列出邮件(步骤 1 — 仅元数据)

bash
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py envelope-list
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py envelope-list --page 2 --page-size 20
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py envelope-list --folder Sent

阅读邮件正文(步骤 2 — 获取内容必需)

bash
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-read

搜索邮件

bash
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py envelope-list from sender@example.com
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py envelope-list subject keyword

发送 / 回复 / 转发

bash
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-send --to email --subject subject --body body
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-send --to a@x.com --cc b@x.com --subject Hi --body msg
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-reply --body reply text
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-reply --body reply text --all
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-forward --to email --body FYI

其他命令

bash
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py folder-list
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-move Archive
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-delete
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py attachment-download --dir ~/Downloads
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py flag-add --flag seen
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py flag-remove --flag seen

提示

  • - 消息 ID 是数字型的,来自最近的 envelope-list 输出。
  • 在运行 message-read、message-reply 等命令之前,始终先运行 envelope-list。
  • 长邮件正文会在 8000 字符处截断。
  • 使用 --page 和 --page-size 来浏览大型收件箱。

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 ews-email-1776279551 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 ews-email-1776279551 技能

通过命令行安装

skillhub install ews-email-1776279551

下载

⬇ 下载 ews-email v1.2.0(免费)

文件大小: 6.25 KB | 发布时间: 2026-4-16 16:17

v1.2.0 最新 2026-4-16 16:17
v1.2.0: Linux headless server support - auto EncryptedKeyring with KEYRING_CRYPTFILE_PASSWORD
返回顶部