Email Management (Gmail, Outlook & Exchange) for Openclaw

A secure, multi-account command-line email client designed for AI agents using Openclaw Skills to safely read, search, and manage Gmail, Outlook, and Exchange inboxes.

porteden
v1.0.7
May 25, 2026
6
9.5k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install email-gmail-outlook

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install email-gmail-outlook using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Email Management (Gmail, Outlook & Exchange)?

The porteden email skill is a high-performance, developer-focused command-line tool designed to integrate seamless, secure email capabilities into AI workflows. Built as a secure alternative to complex API integrations, this skill allows agents to search, retrieve, send, reply to, and archive emails across Gmail, Outlook, and Exchange directories with multi-account support. By leveraging compact JSON outputs, the tool maximizes efficiency and significantly reduces context window usage for LLM automation.

Integrating this tool with Openclaw Skills empowers teams to build robust, secure, and production-ready email automation agents. Built-in security boundaries prevent unsafe mutations, isolate enterprise accounts via profiles, and natively secure credentials using system keyrings.

Email Management (Gmail, Outlook & Exchange) Use Cases

  • Automating inbox triaging and categorization using AI agents to classify incoming emails based on intent or priority.
  • Building smart draft generators that construct context-aware replies to customer inquiries or support tickets.
  • Executing semantic searches across entire conversation histories to synthesize context for software development or client management.
  • Developing scheduled notification systems that aggregate reports and forward them directly to specific target recipients.
  • Integrating multi-account productivity workflows that isolate corporate Exchange directories from personal Gmail accounts safely.

How Email Management (Gmail, Outlook & Exchange) Works

  1. Authentication & Session Init: The CLI authenticates with providers via browser-based OAuth or direct API keys, safely storing credentials in the local system keyring.
  2. Query & Search Formulation: The AI agent issues structured commands using date ranges, labels, or custom keywords to query the active mail server.
  3. Token-Optimized Fetching: The tool retrieves the messages, applying the AI-optimized compact flag (-jc) to minify body previews and eliminate unnecessary token overhead.
  4. Safety Evaluation: For destructive or mutating actions (like sending, replying, or deleting), the agent prompts for human confirmation to prevent accidental transmissions.
  5. Provider Execution: Once authorized, the command is executed natively through the provider's API using provider-prefixed message identifiers.

Email Management (Gmail, Outlook & Exchange) Setup

Installation

Install the porteden CLI using Homebrew or Go:

# Install via Homebrew
brew install porteden/tap/porteden

# Alternatively, install via Go
go install github.com/porteden/cli/cmd/porteden@latest

Authentication

Log in once to store credentials securely in your system's keyring:

# Browser-based login (recommended)
porteden auth login

# Alternatively, log in directly using a token
porteden auth login --token <your_key>

# Verify authentication status
porteden auth status

You can also configure the environment directly by setting the PE_API_KEY environment variable.

Email Management (Gmail, Outlook & Exchange) Data Schema & Taxonomy

Environment Variables

Variable Description
PE_API_KEY API access key for seamless non-interactive CLI authorization.
PE_PROFILE Sets the default mail profile (e.g., work, personal) to avoid manual selection.
PE_TIMEZONE Configures the timezone context for time-filtered queries.
PE_FORMAT Forces specific output serialization formats (e.g., json).

Object Schema Format

The tool returns structured, token-saving compact JSON payloads when invoked with the -jc flag (JSON Compact):

  • Provider-Prefixed IDs: All identifiers are unified and prefixed based on source (e.g., google:abc123 or m365:xyz789).
  • Compact Payload (-jc): Automatically truncates body previews, drops extensive attachment details, and filters redundant metadata to minimize LLM token usage.
  • Pagination Metadata: Large message queries return pagination markers like hasMore and nextPageToken keys inside the parent JSON envelope.

Email Management (Gmail, Outlook & Exchange) Advanced Features

  • Multi-Account Profiles: Use the --profile flag or PE_PROFILE environment variable to isolate different Gmail and Outlook directories natively.
  • AI-Optimized JSON Formatting: Compact JSON serialization (-jc) dramatically compresses body previews and removes heavy attachments to keep agent prompt contexts clean.
  • Granular Least-Privilege Scopes: Configure narrow provider-level authorization scopes during authentication to satisfy strict enterprise security policies.
  • Auto-Pagination: Fetch complete histories by passing the --all flag, allowing the tool to recursively navigate page tokens.
  • Smart Keyring Management: Fully supports native platform keyrings for seamless credential caching and fast revocation with porteden auth logout.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Bins porteden
Github Stars: 0
forks: 0

Featured*