/cloudflare-vm:email-workersfrom cloudflare-vm
Cloudflare Email Workers: Process incoming emails programmatically using Cloudflare Workers runtime.
Ships in cloudflare-vm. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Vendored from themusebook/skills (derived from cloudflare/skills, Apache-2.0). This snapshot may be outdated: confirm limits, pricing, API signatures and config options against https://developers.cloudflare.com/ before you cite them. When this file and the docs disagree, trust the docs.
When invoked: read every file in this skill's directory before answering, so you have the full reference: api.md, configuration.md, gotchas.md, patterns.md. Then answer the user's question (or, if none was given, summarise the product: what it is, config, API, patterns and gotchas). Related products are sibling skills, linked as ../<product>/.
Process incoming emails programmatically using Cloudflare Workers runtime.
Email Workers enable custom email processing logic at the edge. Build spam filters, auto-responders, ticket systems, notification handlers, and more using the same Workers runtime you use for HTTP requests.
Key capabilities:
export default {
async email(message, env, ctx) {
// Reject spam
if (message.from.includes('spam.com')) {
message.setReject('Blocked');
return;
}
// Forward to inbox
await message.forward('[email protected]');
}
};
| Operation | Method | Use Case |
|---|---|---|
| Forward | message.forward(to, headers?) | Route to verified destination |
| Reject | message.setReject(reason) | Block with SMTP error |
| Reply | message.reply(emailMessage) | Auto-respond with threading |
| Parse | postal-mime library | Extract subject, body, attachments |
For comprehensive understanding, read files in this order:
| File | Description | Key Topics |
|---|---|---|
| api.md | Complete API reference | ForwardableEmailMessage, SendEmail bindings, reply() method, postal-mime/mimetext APIs |
| configuration.md | Setup and configuration | wrangler.jsonc, bindings, deployment, dependencies |
| patterns.md | Real-world examples | Allowlists from KV, auto-reply with threading, attachment extraction, webhook notifications |
| gotchas.md | Pitfalls and debugging | Stream consumption, ctx.waitUntil errors, security, limits |
Incoming Email → Email Routing → Email Worker
↓
Process + Decide
↓
┌───────────────┼───────────────┐
↓ ↓ ↓
Forward Reply Reject
Event flow:
[email protected])ForwardableEmailMessagemessage.from, message.to): SMTP transport addresses (trusted)Use envelope addresses for security decisions.
message.raw is a ReadableStream that can only be read once. Buffer to ArrayBuffer for multiple uses.
// Buffer first
const buffer = await new Response(message.raw).arrayBuffer();
const email = await PostalMime.parse(buffer);
See gotchas.md for details.
forward() only works with addresses verified in the Cloudflare Email Routing dashboard. Add destinations before deployment.
| Limit | Value |
|---|---|
| Max message size | 25 MiB |
| Max routing rules | 200 |
| Max destinations | 200 |
| CPU time (free tier) | 10ms |
| CPU time (paid tier) | 30s (default), 5min (max) |
See gotchas.md for complete limits table.
Before deploying Email Workers:
See configuration.md for detailed setup.
Modern projects should use ES modules format shown above. Service Worker syntax (addEventListener('email', ...)) is deprecated but still supported.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vmaia00/claude-specs --plugin cloudflare-vm64 skills in this plugin
/agents-sdkCloudflare Agents SDK: Cloudflare Agents SDK enables building AI-powered agents on Durable Objects with state, WebSockets, SQL, scheduling, and AI integration./ai-gatewayCloudflare AI Gateway: Expert guidance for implementing Cloudflare AI Gateway - a universal gateway for AI model providers with analytics, caching, rate limiting, and routing capabilities./ai-searchCloudflare AI Search Reference: Expert guidance for implementing Cloudflare AI Search (formerly AutoRAG), Cloudflare's managed semantic search and RAG service.Other plugins' skills for the same job