Install
openclaw skills install ews-emailCLI 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.
openclaw skills install ews-emailA CLI for enterprise Exchange (EWS) email. Use when the user asks about email, inbox, messages, or mail.
在 ~/.openclaw/config.yaml 中配置:
env:
EWS_SERVER: "your-exchange-server.com"
EWS_EMAIL: "you@company.com"
pip3 install keyring exchangelib
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py setup
脚本会自动检测 Linux 无桌面环境,切换到 EncryptedKeyring 后端(AES 加密文件存储)。
# 安装依赖
pip3 install keyring exchangelib keyrings.alt
# 设置 master password 环境变量(用于加解密 EWS 密码)
# 在 ~/.openclaw/config.yaml 中添加:
# env:
# KEYRING_CRYPTFILE_PASSWORD: "你自己定义的一个强密码"
#
# 或在 systemd service / 启动脚本中 export:
export KEYRING_CRYPTFILE_PASSWORD="你自己定义的一个强密码"
# 存储 EWS 密码(会用 AES 加密写入本地文件)
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py setup
# 验证
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py folder-list
重启后只要 KEYRING_CRYPTFILE_PASSWORD 环境变量还在,密码就能正常解密读取,无需重新输入。
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py folder-list
setup command.To read the FULL content/body of an email, you MUST follow these two steps:
envelope-list to get the message list (this gives you numeric IDs)message-read <ID> to get the FULL email body/contentenvelope-list only shows subject lines and metadata. It does NOT contain the email body.
You MUST run message-read to get the actual email content. NEVER guess or summarize based on subject alone.
NEVER say you cannot read email content — you CAN, by running message-read.
~/.openclaw/skills/ews-email/scripts/ews-mail.py
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"
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-read <ID>
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
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 <ID> --body "reply text"
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-reply <ID> --body "reply text" --all
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-forward <ID> --to "email" --body "FYI"
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py folder-list
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-move <ID> "Archive"
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-delete <ID>
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py attachment-download <ID> --dir ~/Downloads
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py flag-add <ID> --flag seen
python3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py flag-remove <ID> --flag seen
envelope-list output.envelope-list first before message-read, message-reply, etc.--page and --page-size to navigate large inboxes.