{"skill":{"slug":"ews-email","displayName":"Ews Email","summary":"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...","description":"---\nlicense: MIT\nname: ews-email\nversion: 1.2.0\ndescription: \"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.\"\nmetadata:\n  openclaw:\n    emoji: \"📧\"\n    requires:\n      bins: [\"python3\"]\n      pips: [\"keyring\", \"exchangelib\"]\n    primaryEnv: \"EWS_EMAIL\"\n---\n\n# EWS Email CLI\n\nA CLI for enterprise Exchange (EWS) email. Use when the user asks about email, inbox, messages, or mail.\n\n## Setup\n\n### 1. 环境变量\n\n在 `~/.openclaw/config.yaml` 中配置：\n\n```yaml\nenv:\n  EWS_SERVER: \"your-exchange-server.com\"\n  EWS_EMAIL: \"you@company.com\"\n```\n\n### 2. 存储密码\n\n#### macOS（自动使用 Keychain，无需额外配置）\n\n```bash\npip3 install keyring exchangelib\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py setup\n```\n\n#### Linux 云服务器（无桌面环境）\n\n脚本会自动检测 Linux 无桌面环境，切换到 EncryptedKeyring 后端（AES 加密文件存储）。\n\n```bash\n# 安装依赖\npip3 install keyring exchangelib keyrings.alt\n\n# 设置 master password 环境变量（用于加解密 EWS 密码）\n# 在 ~/.openclaw/config.yaml 中添加：\n#   env:\n#     KEYRING_CRYPTFILE_PASSWORD: \"你自己定义的一个强密码\"\n#\n# 或在 systemd service / 启动脚本中 export：\nexport KEYRING_CRYPTFILE_PASSWORD=\"你自己定义的一个强密码\"\n\n# 存储 EWS 密码（会用 AES 加密写入本地文件）\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py setup\n\n# 验证\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py folder-list\n```\n\n重启后只要 `KEYRING_CRYPTFILE_PASSWORD` 环境变量还在，密码就能正常解密读取，无需重新输入。\n\n### 3. 验证安装\n\n```bash\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py folder-list\n```\n\n## SECURITY RULES\n\n- **NEVER** attempt to read, display, or output the EWS password.\n- **NEVER** run commands that could expose keyring contents.\n- **NEVER** include passwords in any output, log, or message.\n- The password is managed exclusively through the `setup` command.\n\n## IMPORTANT: Reading Email Content\n\nTo read the FULL content/body of an email, you MUST follow these two steps:\n\n1. First run `envelope-list` to get the message list (this gives you numeric IDs)\n2. Then run `message-read <ID>` to get the FULL email body/content\n\n**`envelope-list` only shows subject lines and metadata. It does NOT contain the email body.**\n**You MUST run `message-read` to get the actual email content. NEVER guess or summarize based on subject alone.**\n**NEVER say you cannot read email content — you CAN, by running `message-read`.**\n\n## Script Location\n\n`~/.openclaw/skills/ews-email/scripts/ews-mail.py`\n\n## Commands\n\n### List Emails (step 1 — metadata only)\n\n```bash\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py envelope-list\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py envelope-list --page 2 --page-size 20\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py envelope-list --folder \"Sent\"\n```\n\n### Read Email Body (step 2 — REQUIRED for content)\n\n```bash\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-read <ID>\n```\n\n### Search Emails\n\n```bash\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py envelope-list from sender@example.com\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py envelope-list subject keyword\n```\n\n### Send / Reply / Forward\n\n```bash\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-send --to \"email\" --subject \"subject\" --body \"body\"\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-send --to \"a@x.com\" --cc \"b@x.com\" --subject \"Hi\" --body \"msg\"\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-reply <ID> --body \"reply text\"\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-reply <ID> --body \"reply text\" --all\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-forward <ID> --to \"email\" --body \"FYI\"\n```\n\n### Other Commands\n\n```bash\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py folder-list\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-move <ID> \"Archive\"\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py message-delete <ID>\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py attachment-download <ID> --dir ~/Downloads\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py flag-add <ID> --flag seen\npython3 ~/.openclaw/skills/ews-email/scripts/ews-mail.py flag-remove <ID> --flag seen\n```\n\n## Tips\n\n- Message IDs are numeric and come from the most recent `envelope-list` output.\n- Always run `envelope-list` first before `message-read`, `message-reply`, etc.\n- Long email bodies are truncated at 8000 chars.\n- Use `--page` and `--page-size` to navigate large inboxes.\n","topics":["Email"],"tags":{"latest":"1.2.0"},"stats":{"comments":0,"downloads":894,"installsAllTime":33,"installsCurrent":2,"stars":0,"versions":3},"createdAt":1772505682623,"updatedAt":1778491695332},"latestVersion":{"version":"1.2.0","createdAt":1773038581495,"changelog":"v1.2.0: Linux headless server support - auto EncryptedKeyring with KEYRING_CRYPTFILE_PASSWORD","license":"MIT-0"},"metadata":{"setup":[],"os":null,"systems":null},"owner":{"handle":"guyun94","userId":"s17drtw9ms8jkd228ea3khx48n83gh5c","displayName":"guyun94","image":"https://avatars.githubusercontent.com/u/32215857?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089809544}}