secondsky/claude-skills / plugins/cloudflare-email-routing/skills/cloudflare-email-routing
cloudflare-email-routing
UnverifiedCloudflare Email Routing for receiving/sending emails via Workers. Use for email workers, forwarding, allowlists, or encountering Email Trigger errors, worker call failures, SPF issues.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 11.0 KB |
| references/common-errors.md | markdown | 16.1 KB |
| references/dns-setup.md | markdown | 11.9 KB |
| references/local-development.md | markdown | 14.7 KB |
| references/setup-guide.md | markdown | 4.2 KB |
| templates/receive-allowlist.ts | script | 1.8 KB |
| templates/receive-basic.ts | script | 1.6 KB |
| templates/receive-blocklist.ts | script | 1.8 KB |
| templates/receive-reply.ts | script | 2.7 KB |
| templates/send-basic.ts | script | 2.1 KB |
| templates/send-notification.ts | script | 4.5 KB |
| templates/wrangler-email.jsonc | other | 1.8 KB |
templates/receive-basic.ts
View on GitHub/**
* Basic Email Worker - Simple Forwarding
*
* This worker receives emails and forwards them to a verified destination.
* Use this as a starting point for email processing.
*
* Features:
* - Log sender, recipient, and basic metadata
* - Forward to verified destination address
* - Error handling with rejection
*
* To use:
* 1. Install dependencies: npm install postal-mime
* 2. Deploy: npx wrangler deploy
* 3. Bind to email route in Cloudflare Dashboard
*/
import PostalMime from 'postal-mime';
interface Env {
// Add environment bindings here if needed
// DB?: D1Database;
// EMAIL_CACHE?: KVNamespace;
}
export default {
async email(message, env: Env, ctx) {
try {
// Log basic email metadata
console.log('Received email from:', message.from);
console.log('To:', message.to);
console.log('Size:', message.rawSize, 'bytes');
// Parse email to access subject and body
const parser = new PostalMime.default();
const email = await parser.parse(
await new Response(message.raw).arrayBuffer()
);
console.log('Subject:', email.subject);
console.log('Text preview:', email.text?.substring(0, 100));
// Forward to verified destination
// IMPORTANT: Replace with your verified destination address
await message.forward('your-inbox@example.com');
console.log('Email forwarded successfully');
} catch (error) {
// Log error and reject email
console.error('Error processing email:', error);
message.setReject('Unable to process email');
}
},
};
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |