npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

openclaw-agentmail

v1.1.0

Published

AgentMail email channel plugin for OpenClaw - secure, reply-only email integration

Readme

openclaw-agentmail

AgentMail email channel plugin for OpenClaw — secure, reply-only email integration via AgentMail.

Features

  • Real-time email via WebSocket — No polling, instant message delivery
  • Reply-only mode — Cannot send emails to arbitrary addresses (security hardening)
  • Sender filteringallowFrom whitelist for allowed senders
  • Thread context — Full email thread loaded for AI context
  • Attachment support — Downloads attachments and makes them available to the agent
  • Single email replies — Batch mode ensures one coherent response per email
  • No agent tools — Direct email API access disabled for safety

Security

This plugin has been hardened for security:

  1. Outbound restricted to replies only — The plugin throws an error if attempting to send a new email without a replyToId. Only replies to existing threads are allowed.

  2. Agent tools disabled — The AgentMail toolkit is not exposed to the agent, preventing programmatic email sending.

  3. Sender filtering — Only emails from addresses/domains in allowFrom trigger the agent.

Installation

Option 1: CLI Install (Recommended)

# Install from GitHub
openclaw plugins install github:wko/openclaw-agentmail

# Enable the plugin
openclaw plugins enable agentmail

Option 2: Development (Linked)

For local development with live changes:

git clone https://github.com/wko/openclaw-agentmail.git
cd openclaw-agentmail
openclaw plugins install -l .
openclaw plugins enable agentmail

The -l/--link flag symlinks instead of copying — changes are reflected immediately.

Option 3: Docker / Containerized

Add to your package.json:

{
  "dependencies": {
    "openclaw-agentmail": "github:wko/openclaw-agentmail"
  }
}

Then symlink in your Dockerfile after pnpm install:

RUN ln -sf /app/node_modules/openclaw-agentmail /app/extensions/agentmail

OpenClaw discovers plugins via the extensions/ folder.


## Configuration

Add to your OpenClaw config:

```json5
{
  channels: {
    agentmail: {
      enabled: true,
      token: "am_your_agentmail_api_token",
      emailAddress: "[email protected]",
      allowFrom: [
        "[email protected]",
        "example.org"  // allows all @example.org
      ]
    }
  }
}

Environment Variables

Alternatively, use environment variables:

  • AGENTMAIL_TOKEN — API token
  • AGENTMAIL_EMAIL_ADDRESS — Inbox address

Configuration Options

| Key | Type | Default | Description | |-----|------|---------|-------------| | enabled | boolean | true | Enable/disable the channel | | token | string | — | AgentMail API token (required) | | emailAddress | string | — | Inbox email address (required) | | allowFrom | string[] | [] | Allowed sender emails/domains (empty = allow all) | | blockStreaming | boolean | false | Send intermediate replies as separate emails. When false (default), only the final reply is sent as one email. |

How It Works

  1. Plugin connects to AgentMail via WebSocket on gateway start
  2. Incoming emails are filtered by allowFrom
  3. Attachments are downloaded and saved to temp directory
  4. Full thread context is fetched for the AI
  5. Agent receives email with MediaPath/MediaPaths pointing to attachments
  6. Agent's reply is sent via replyAll to maintain threading
  7. Only replies are allowed — no new emails to arbitrary addresses

Attachment Handling

Email attachments are automatically downloaded and made available to the agent:

  • Images (JPEG, PNG, etc.) — Agent can view via vision capabilities
  • Documents (PDF, TXT, etc.) — Saved locally, path provided to agent
  • All files — Downloaded to temp directory, paths in MediaPaths context field

The agent sees attachments the same way as other channels (Telegram, WhatsApp):

MediaPath: /tmp/openclaw-agentmail/<uuid>/invoice.pdf
MediaPaths: ["/tmp/.../invoice.pdf", "/tmp/.../photo.jpg"]
MediaTypes: ["application/pdf", "image/jpeg"]

Note: Attachments are saved to a temp directory and cleaned up by the OS. For persistent storage, the agent can copy files to a permanent location.

Credits

Based on PR #2499 by @Haakam21, with security hardening.

License

MIT