[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79A3365P75A1T5WE2FW36HC":3,"skill-same:01M79A3365P75A1T5WE2FW36HC":127},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":14,"repositoryHtmlUrl":61,"repositoryHomepageUrl":6,"ownerHtmlUrl":62,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":63,"install":64,"resources":76},"01M79A3365P75A1T5WE2FW36HC","cloudflare-email-routing",null,"Cloudflare Email Routing for receiving\u002Fsending emails via Workers. Use for email workers, forwarding, allowlists, or encountering Email Trigger errors, worker call failures, SPF issues.","Elogic360\u002Fsoftware-factory","Elogic360","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F156535519?v=4","01M74NH3F0RB13PWB7JZDE2V80","elogic360","01M74NH3FPC65082MDZVMFHDM3",0,"MIT","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cloudflare-email-routing\ndescription: \"Cloudflare Email Routing for receiving\u002Fsending emails via Workers. Use for email workers, forwarding, allowlists, or encountering Email Trigger errors, worker call failures, SPF issues.\"\nlicense: MIT\nmetadata:\n  version: \"2.0.0\"\n  last_verified: \"2025-11-18\"\n  production_tested: true\n  token_savings: \"~60%\"\n  errors_prevented: 8\n  templates_included: 0\n  references_included: 1\n  keywords:\n    - Cloudflare Email Routing\n    - Email Workers\n    - send email\n    - receive email\n    - email forwarding\n    - email allowlist\n    - email blocklist\n    - postal-mime\n    - mimetext\n    - \"cloudflare:email\"\n    - EmailMessage\n    - ForwardableEmailMessage\n    - EmailEvent\n    - MX records\n    - SPF\n    - DKIM\n    - email worker binding\n    - send_email binding\n    - wrangler email\n    - email handler\n    - email routing worker\n    - \"\\\"Email Trigger not available\\\"\"\n    - \"\\\"failed to call worker\\\"\"\n    - email delivery failed\n    - email not forwarding\n    - destination address not verified\n---\n# Cloudflare Email Routing\n\n**Status**: Production Ready ✅ | **Last Verified**: 2025-11-18\n\n---\n\n## What Is Email Routing?\n\nTwo capabilities:\n\n1. **Email Workers** - Receive and process incoming emails (allowlists, forwarding, parsing)\n2. **Send Email** - Send emails from Workers to verified addresses\n\nBoth **free** and work together for complete email functionality.\n\n---\n\n## Quick Start (10 Minutes)\n\n### Part 1: Enable Email Routing\n\n**Dashboard setup:**\n1. Dashboard → Domain → **Email** → **Email Routing**\n2. **Enable Email Routing** → **Add records and enable**\n3. Create destination address:\n   - Custom: `hello@yourdomain.com`\n   - Destination: Your email\n   - Verify via email\n4. ✅ Basic forwarding active\n\n### Part 2: Receiving Emails (Email Workers)\n\n**Install dependencies:**\n\n```bash\nbun add postal-mime@2.5.0 mimetext@3.0.27\n```\n\n**Create email worker:**\n\n```typescript\n\u002F\u002F src\u002Femail.ts\nimport { EmailMessage } from 'cloudflare:email';\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    console.log('From:', message.from);\n    console.log('Subject:', email.subject);\n\n    \u002F\u002F Forward to destination\n    await message.forward('you@gmail.com');\n  }\n};\n```\n\n**Configure wrangler.jsonc:**\n\n```jsonc\n{\n  \"name\": \"email-worker\",\n  \"main\": \"src\u002Femail.ts\",\n  \"compatibility_date\": \"2025-10-11\",\n  \"node_compat\": true  \u002F\u002F Required!\n}\n```\n\n**Deploy and connect:**\n\n```bash\nbunx wrangler deploy\n```\n\nDashboard → Email Workers → **Create address** → Select worker\n\n### Part 3: Sending Emails\n\n**Add send email binding:**\n\n```jsonc\n{\n  \"name\": \"my-worker\",\n  \"main\": \"src\u002Findex.ts\",\n  \"compatibility_date\": \"2025-10-11\",\n  \"send_email\": [\n    {\n      \"name\": \"SES\",\n      \"destination_address\": \"user@example.com\"\n    }\n  ]\n}\n```\n\n**Send from worker:**\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport { createMimeMessage } from 'mimetext';\n\nconst msg = createMimeMessage();\nmsg.setSender({ name: 'App', addr: 'noreply@yourdomain.com' });\nmsg.setRecipient('user@example.com');\nmsg.setSubject('Hello!');\nmsg.addMessage({\n  contentType: 'text\u002Fplain',\n  data: 'Email body here'\n});\n\nconst message = new EmailMessage(\n  'noreply@yourdomain.com',\n  'user@example.com',\n  msg.asRaw()\n);\n\nawait env.SES.send(message);\n```\n\n**Load `references\u002Fsetup-guide.md` for complete walkthrough.**\n\n---\n\n## Critical Rules\n\n### Always Do ✅\n\n1. **Enable node_compat: true** for postal-mime\n2. **Verify destination addresses** before sending\n3. **Parse with postal-mime** for email content\n4. **Use mimetext** for creating emails\n5. **Check message.from** for allowlists\n6. **Forward with message.forward()** (not manual)\n7. **Handle errors** (email delivery can fail)\n8. **Test with real emails** (not just dashboard)\n9. **Add MX records** (automatic via dashboard)\n10. **Log email activity** for debugging\n\n### Never Do ❌\n\n1. **Never skip node_compat** (postal-mime requires it)\n2. **Never send without verification** (delivery fails)\n3. **Never hardcode email addresses** in public code\n4. **Never skip parsing** (raw email is hard to work with)\n5. **Never ignore spam** (implement allowlists\u002Fblocklists)\n6. **Never exceed Gmail limits** (500 emails\u002Fday to Gmail)\n7. **Never skip error handling** (emails can fail)\n8. **Never modify DNS manually** (use dashboard)\n9. **Never expose email content** in logs (PII)\n10. **Never assume instant delivery** (email is async)\n\n---\n\n## Common Patterns\n\n### Allowlist\n\n```typescript\nconst allowlist = ['approved@domain.com'];\n\nif (!allowlist.includes(message.from)) {\n  message.setReject('Not on allowlist');\n  return;\n}\n\nawait message.forward('you@gmail.com');\n```\n\n### Blocklist\n\n```typescript\nconst blocklist = ['spam@bad.com'];\n\nif (blocklist.includes(message.from)) {\n  message.setReject('Blocked');\n  return;\n}\n\nawait message.forward('you@gmail.com');\n```\n\n### Reply to Email\n\n```typescript\nconst msg = createMimeMessage();\nmsg.setSender({ addr: 'noreply@yourdomain.com' });\nmsg.setRecipient(message.from);\nmsg.setSubject(`Re: ${email.subject}`);\nmsg.addMessage({\n  contentType: 'text\u002Fplain',\n  data: 'Thanks for your email!'\n});\n\nconst reply = new EmailMessage(\n  'noreply@yourdomain.com',\n  message.from,\n  msg.asRaw()\n);\n\nawait env.SES.send(reply);\n```\n\n### Parse Attachments\n\n```typescript\nconst parser = new PostalMime.default();\nconst email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\nfor (const attachment of email.attachments) {\n  console.log('Filename:', attachment.filename);\n  console.log('Type:', attachment.mimeType);\n  console.log('Size:', attachment.content.byteLength);\n}\n```\n\n### Custom Routing Logic\n\n```typescript\nasync email(message, env, ctx) {\n  const parser = new PostalMime.default();\n  const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n  \u002F\u002F Route based on subject\n  if (email.subject.includes('[Support]')) {\n    await message.forward('support@yourdomain.com');\n  } else if (email.subject.includes('[Sales]')) {\n    await message.forward('sales@yourdomain.com');\n  } else {\n    await message.forward('general@yourdomain.com');\n  }\n}\n```\n\n---\n\n## Email Message Properties\n\n### Incoming Messages (ForwardableEmailMessage)\n\n```typescript\nmessage.from        \u002F\u002F Sender email\nmessage.to          \u002F\u002F Recipient email\nmessage.headers     \u002F\u002F Email headers\nmessage.raw         \u002F\u002F Raw email stream\nmessage.rawSize     \u002F\u002F Size in bytes\n\n\u002F\u002F Methods\nmessage.forward(address)        \u002F\u002F Forward to address\nmessage.setReject(reason)       \u002F\u002F Reject email\n```\n\n### Parsed Email (PostalMime)\n\n```typescript\nemail.from          \u002F\u002F { name, address }\nemail.to            \u002F\u002F [{ name, address }]\nemail.subject       \u002F\u002F Subject line\nemail.text          \u002F\u002F Plain text body\nemail.html          \u002F\u002F HTML body\nemail.attachments   \u002F\u002F Array of attachments\nemail.headers       \u002F\u002F All headers\n```\n\n---\n\n## Top 5 Errors Prevented\n\n1. **\"Email Trigger not available\"**: Enable node_compat: true\n2. **Destination not verified**: Verify all send destinations\n3. **Gmail rate limit**: Max 500 emails\u002Fday to Gmail\n4. **SPF permerror**: Use dashboard to configure DNS\n5. **Worker call failed**: Check logs for parsing errors\n\n---\n\n## Use Cases\n\n### Use Case 1: Support Ticket System\n\n```typescript\nasync email(message, env, ctx) {\n  const parser = new PostalMime.default();\n  const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n  \u002F\u002F Create ticket in database\n  await env.DB.prepare(\n    'INSERT INTO tickets (email, subject, body, created_at) VALUES (?, ?, ?, ?)'\n  ).bind(message.from, email.subject, email.text, Date.now()).run();\n\n  \u002F\u002F Send confirmation\n  const msg = createMimeMessage();\n  msg.setSender({ addr: 'support@yourdomain.com' });\n  msg.setRecipient(message.from);\n  msg.setSubject('Ticket Created');\n  msg.addMessage({\n    contentType: 'text\u002Fplain',\n    data: 'Your support ticket has been created.'\n  });\n\n  const confirmation = new EmailMessage(\n    'support@yourdomain.com',\n    message.from,\n    msg.asRaw()\n  );\n\n  await env.SES.send(confirmation);\n}\n```\n\n### Use Case 2: Email Notifications\n\n```typescript\nexport default {\n  async fetch(request, env, ctx) {\n    \u002F\u002F User signup\n    const { email, name } = await request.json();\n\n    const msg = createMimeMessage();\n    msg.setSender({ name: 'App', addr: 'noreply@yourdomain.com' });\n    msg.setRecipient(email);\n    msg.setSubject('Welcome!');\n    msg.addMessage({\n      contentType: 'text\u002Fhtml',\n      data: `\u003Ch1>Welcome, ${name}!\u003C\u002Fh1>`\n    });\n\n    const message = new EmailMessage(\n      'noreply@yourdomain.com',\n      email,\n      msg.asRaw()\n    );\n\n    await env.SES.send(message);\n\n    return new Response('Welcome email sent!');\n  }\n};\n```\n\n### Use Case 3: Email Forwarding with Filtering\n\n```typescript\nasync email(message, env, ctx) {\n  const parser = new PostalMime.default();\n  const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n  \u002F\u002F Filter spam keywords\n  const spamKeywords = ['viagra', 'lottery', 'prince'];\n  const isSpam = spamKeywords.some(keyword =>\n    email.subject.toLowerCase().includes(keyword) ||\n    email.text.toLowerCase().includes(keyword)\n  );\n\n  if (isSpam) {\n    message.setReject('Spam detected');\n    return;\n  }\n\n  await message.forward('you@gmail.com');\n}\n```\n\n---\n\n## When to Load References\n\n### Load `references\u002Fsetup-guide.md` when:\n- First-time Email Routing setup\n- Configuring MX records\n- Setting up email workers\n- Configuring send email binding\n- Complete walkthrough needed\n\n---\n\n## Using Bundled Resources\n\n**References** (`references\u002F`):\n- `setup-guide.md` - Complete setup walkthrough (enabling routing, email workers, send email)\n- `common-errors.md` - All 8 documented errors with solutions and prevention\n- `dns-setup.md` - MX records, SPF, DKIM configuration guide\n- `local-development.md` - Local testing and development patterns\n\n**Templates** (`templates\u002F`):\n- `receive-basic.ts` - Basic email receiving worker\n- `receive-allowlist.ts` - Email allowlist implementation\n- `receive-blocklist.ts` - Email blocklist implementation\n- `receive-reply.ts` - Auto-reply email worker\n- `send-basic.ts` - Basic send email example\n- `send-notification.ts` - Notification email pattern\n- `wrangler-email.jsonc` - Wrangler configuration for email routing\n\n---\n\n## Official Documentation\n\n- **Email Routing**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002F\n- **Email Workers**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002F\n- **Send Email**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002Fsend-email-workers\u002F\n\n---\n\n**Questions? Issues?**\n\n1. Check `references\u002Fsetup-guide.md` for complete setup\n2. Verify node_compat: true in wrangler.jsonc\n3. Confirm destination addresses verified\n4. Check logs for errors\n","# Cloudflare Email Routing\n\n**Status**: Production Ready ✅ | **Last Verified**: 2025-11-18\n\n---\n\n## What Is Email Routing?\n\nTwo capabilities:\n\n1. **Email Workers** - Receive and process incoming emails (allowlists, forwarding, parsing)\n2. **Send Email** - Send emails from Workers to verified addresses\n\nBoth **free** and work together for complete email functionality.\n\n---\n\n## Quick Start (10 Minutes)\n\n### Part 1: Enable Email Routing\n\n**Dashboard setup:**\n1. Dashboard → Domain → **Email** → **Email Routing**\n2. **Enable Email Routing** → **Add records and enable**\n3. Create destination address:\n   - Custom: `hello@yourdomain.com`\n   - Destination: Your email\n   - Verify via email\n4. ✅ Basic forwarding active\n\n### Part 2: Receiving Emails (Email Workers)\n\n**Install dependencies:**\n\n```bash\nbun add postal-mime@2.5.0 mimetext@3.0.27\n```\n\n**Create email worker:**\n\n```typescript\n\u002F\u002F src\u002Femail.ts\nimport { EmailMessage } from 'cloudflare:email';\nimport PostalMime from 'postal-mime';\n\nexport default {\n  async email(message, env, ctx) {\n    const parser = new PostalMime.default();\n    const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n    console.log('From:', message.from);\n    console.log('Subject:', email.subject);\n\n    \u002F\u002F Forward to destination\n    await message.forward('you@gmail.com');\n  }\n};\n```\n\n**Configure wrangler.jsonc:**\n\n```jsonc\n{\n  \"name\": \"email-worker\",\n  \"main\": \"src\u002Femail.ts\",\n  \"compatibility_date\": \"2025-10-11\",\n  \"node_compat\": true  \u002F\u002F Required!\n}\n```\n\n**Deploy and connect:**\n\n```bash\nbunx wrangler deploy\n```\n\nDashboard → Email Workers → **Create address** → Select worker\n\n### Part 3: Sending Emails\n\n**Add send email binding:**\n\n```jsonc\n{\n  \"name\": \"my-worker\",\n  \"main\": \"src\u002Findex.ts\",\n  \"compatibility_date\": \"2025-10-11\",\n  \"send_email\": [\n    {\n      \"name\": \"SES\",\n      \"destination_address\": \"user@example.com\"\n    }\n  ]\n}\n```\n\n**Send from worker:**\n\n```typescript\nimport { EmailMessage } from 'cloudflare:email';\nimport { createMimeMessage } from 'mimetext';\n\nconst msg = createMimeMessage();\nmsg.setSender({ name: 'App', addr: 'noreply@yourdomain.com' });\nmsg.setRecipient('user@example.com');\nmsg.setSubject('Hello!');\nmsg.addMessage({\n  contentType: 'text\u002Fplain',\n  data: 'Email body here'\n});\n\nconst message = new EmailMessage(\n  'noreply@yourdomain.com',\n  'user@example.com',\n  msg.asRaw()\n);\n\nawait env.SES.send(message);\n```\n\n**Load `references\u002Fsetup-guide.md` for complete walkthrough.**\n\n---\n\n## Critical Rules\n\n### Always Do ✅\n\n1. **Enable node_compat: true** for postal-mime\n2. **Verify destination addresses** before sending\n3. **Parse with postal-mime** for email content\n4. **Use mimetext** for creating emails\n5. **Check message.from** for allowlists\n6. **Forward with message.forward()** (not manual)\n7. **Handle errors** (email delivery can fail)\n8. **Test with real emails** (not just dashboard)\n9. **Add MX records** (automatic via dashboard)\n10. **Log email activity** for debugging\n\n### Never Do ❌\n\n1. **Never skip node_compat** (postal-mime requires it)\n2. **Never send without verification** (delivery fails)\n3. **Never hardcode email addresses** in public code\n4. **Never skip parsing** (raw email is hard to work with)\n5. **Never ignore spam** (implement allowlists\u002Fblocklists)\n6. **Never exceed Gmail limits** (500 emails\u002Fday to Gmail)\n7. **Never skip error handling** (emails can fail)\n8. **Never modify DNS manually** (use dashboard)\n9. **Never expose email content** in logs (PII)\n10. **Never assume instant delivery** (email is async)\n\n---\n\n## Common Patterns\n\n### Allowlist\n\n```typescript\nconst allowlist = ['approved@domain.com'];\n\nif (!allowlist.includes(message.from)) {\n  message.setReject('Not on allowlist');\n  return;\n}\n\nawait message.forward('you@gmail.com');\n```\n\n### Blocklist\n\n```typescript\nconst blocklist = ['spam@bad.com'];\n\nif (blocklist.includes(message.from)) {\n  message.setReject('Blocked');\n  return;\n}\n\nawait message.forward('you@gmail.com');\n```\n\n### Reply to Email\n\n```typescript\nconst msg = createMimeMessage();\nmsg.setSender({ addr: 'noreply@yourdomain.com' });\nmsg.setRecipient(message.from);\nmsg.setSubject(`Re: ${email.subject}`);\nmsg.addMessage({\n  contentType: 'text\u002Fplain',\n  data: 'Thanks for your email!'\n});\n\nconst reply = new EmailMessage(\n  'noreply@yourdomain.com',\n  message.from,\n  msg.asRaw()\n);\n\nawait env.SES.send(reply);\n```\n\n### Parse Attachments\n\n```typescript\nconst parser = new PostalMime.default();\nconst email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\nfor (const attachment of email.attachments) {\n  console.log('Filename:', attachment.filename);\n  console.log('Type:', attachment.mimeType);\n  console.log('Size:', attachment.content.byteLength);\n}\n```\n\n### Custom Routing Logic\n\n```typescript\nasync email(message, env, ctx) {\n  const parser = new PostalMime.default();\n  const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n  \u002F\u002F Route based on subject\n  if (email.subject.includes('[Support]')) {\n    await message.forward('support@yourdomain.com');\n  } else if (email.subject.includes('[Sales]')) {\n    await message.forward('sales@yourdomain.com');\n  } else {\n    await message.forward('general@yourdomain.com');\n  }\n}\n```\n\n---\n\n## Email Message Properties\n\n### Incoming Messages (ForwardableEmailMessage)\n\n```typescript\nmessage.from        \u002F\u002F Sender email\nmessage.to          \u002F\u002F Recipient email\nmessage.headers     \u002F\u002F Email headers\nmessage.raw         \u002F\u002F Raw email stream\nmessage.rawSize     \u002F\u002F Size in bytes\n\n\u002F\u002F Methods\nmessage.forward(address)        \u002F\u002F Forward to address\nmessage.setReject(reason)       \u002F\u002F Reject email\n```\n\n### Parsed Email (PostalMime)\n\n```typescript\nemail.from          \u002F\u002F { name, address }\nemail.to            \u002F\u002F [{ name, address }]\nemail.subject       \u002F\u002F Subject line\nemail.text          \u002F\u002F Plain text body\nemail.html          \u002F\u002F HTML body\nemail.attachments   \u002F\u002F Array of attachments\nemail.headers       \u002F\u002F All headers\n```\n\n---\n\n## Top 5 Errors Prevented\n\n1. **\"Email Trigger not available\"**: Enable node_compat: true\n2. **Destination not verified**: Verify all send destinations\n3. **Gmail rate limit**: Max 500 emails\u002Fday to Gmail\n4. **SPF permerror**: Use dashboard to configure DNS\n5. **Worker call failed**: Check logs for parsing errors\n\n---\n\n## Use Cases\n\n### Use Case 1: Support Ticket System\n\n```typescript\nasync email(message, env, ctx) {\n  const parser = new PostalMime.default();\n  const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n  \u002F\u002F Create ticket in database\n  await env.DB.prepare(\n    'INSERT INTO tickets (email, subject, body, created_at) VALUES (?, ?, ?, ?)'\n  ).bind(message.from, email.subject, email.text, Date.now()).run();\n\n  \u002F\u002F Send confirmation\n  const msg = createMimeMessage();\n  msg.setSender({ addr: 'support@yourdomain.com' });\n  msg.setRecipient(message.from);\n  msg.setSubject('Ticket Created');\n  msg.addMessage({\n    contentType: 'text\u002Fplain',\n    data: 'Your support ticket has been created.'\n  });\n\n  const confirmation = new EmailMessage(\n    'support@yourdomain.com',\n    message.from,\n    msg.asRaw()\n  );\n\n  await env.SES.send(confirmation);\n}\n```\n\n### Use Case 2: Email Notifications\n\n```typescript\nexport default {\n  async fetch(request, env, ctx) {\n    \u002F\u002F User signup\n    const { email, name } = await request.json();\n\n    const msg = createMimeMessage();\n    msg.setSender({ name: 'App', addr: 'noreply@yourdomain.com' });\n    msg.setRecipient(email);\n    msg.setSubject('Welcome!');\n    msg.addMessage({\n      contentType: 'text\u002Fhtml',\n      data: `\u003Ch1>Welcome, ${name}!\u003C\u002Fh1>`\n    });\n\n    const message = new EmailMessage(\n      'noreply@yourdomain.com',\n      email,\n      msg.asRaw()\n    );\n\n    await env.SES.send(message);\n\n    return new Response('Welcome email sent!');\n  }\n};\n```\n\n### Use Case 3: Email Forwarding with Filtering\n\n```typescript\nasync email(message, env, ctx) {\n  const parser = new PostalMime.default();\n  const email = await parser.parse(await new Response(message.raw).arrayBuffer());\n\n  \u002F\u002F Filter spam keywords\n  const spamKeywords = ['viagra', 'lottery', 'prince'];\n  const isSpam = spamKeywords.some(keyword =>\n    email.subject.toLowerCase().includes(keyword) ||\n    email.text.toLowerCase().includes(keyword)\n  );\n\n  if (isSpam) {\n    message.setReject('Spam detected');\n    return;\n  }\n\n  await message.forward('you@gmail.com');\n}\n```\n\n---\n\n## When to Load References\n\n### Load `references\u002Fsetup-guide.md` when:\n- First-time Email Routing setup\n- Configuring MX records\n- Setting up email workers\n- Configuring send email binding\n- Complete walkthrough needed\n\n---\n\n## Using Bundled Resources\n\n**References** (`references\u002F`):\n- `setup-guide.md` - Complete setup walkthrough (enabling routing, email workers, send email)\n- `common-errors.md` - All 8 documented errors with solutions and prevention\n- `dns-setup.md` - MX records, SPF, DKIM configuration guide\n- `local-development.md` - Local testing and development patterns\n\n**Templates** (`templates\u002F`):\n- `receive-basic.ts` - Basic email receiving worker\n- `receive-allowlist.ts` - Email allowlist implementation\n- `receive-blocklist.ts` - Email blocklist implementation\n- `receive-reply.ts` - Auto-reply email worker\n- `send-basic.ts` - Basic send email example\n- `send-notification.ts` - Notification email pattern\n- `wrangler-email.jsonc` - Wrangler configuration for email routing\n\n---\n\n## Official Documentation\n\n- **Email Routing**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002F\n- **Email Workers**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002F\n- **Send Email**: https:\u002F\u002Fdevelopers.cloudflare.com\u002Femail-routing\u002Femail-workers\u002Fsend-email-workers\u002F\n\n---\n\n**Questions? Issues?**\n\n1. Check `references\u002Fsetup-guide.md` for complete setup\n2. Verify node_compat: true in wrangler.jsonc\n3. Confirm destination addresses verified\n4. Check logs for errors\n",{"name":5,"license":15,"metadata":24,"description":7},{"version":25,"keywords":26,"last_verified":53,"token_savings":54,"errors_prevented":55,"production_tested":56,"templates_included":14,"references_included":57},"2.0.0",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],"Cloudflare Email Routing","Email Workers","send email","receive email","email forwarding","email allowlist","email blocklist","postal-mime","mimetext","cloudflare:email","EmailMessage","ForwardableEmailMessage","EmailEvent","MX records","SPF","DKIM","email worker binding","send_email binding","wrangler email","email handler","email routing worker","\"Email Trigger not available\"","\"failed to call worker\"","email delivery failed","email not forwarding","destination address not verified","2025-11-18","~60%",8,true,1,"main","c475fc64e94e803b50d14a791dfee8853fbb2c5c","integrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory","https:\u002F\u002Fgithub.com\u002FElogic360","2026-11-08 22:21:22",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":56},[66,69,72],{"tool":67,"command":68},"npx","npx skills add Elogic360\u002Fsoftware-factory --skill cloudflare-email-routing",{"tool":70,"command":71},"bunx","bunx skills add Elogic360\u002Fsoftware-factory --skill cloudflare-email-routing",{"tool":73,"command":74},"pnpm","pnpm dlx skills add Elogic360\u002Fsoftware-factory --skill cloudflare-email-routing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002FSKILL.md",[77,83,87,91,95,101,105,109,113,117,121],{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fcommon-errors.md","REFERENCE","参考文档",16443,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Freferences\u002Fcommon-errors.md",{"path":84,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fdns-setup.md",12142,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Freferences\u002Fdns-setup.md",{"path":88,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Flocal-development.md",15083,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Freferences\u002Flocal-development.md",{"path":92,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fsetup-guide.md",4230,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Freferences\u002Fsetup-guide.md",{"path":96,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":99,"sourceHtmlUrl":100},"templates\u002Freceive-allowlist.ts","SCRIPT","脚本",1806,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Ftemplates\u002Freceive-allowlist.ts",{"path":102,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":103,"sourceHtmlUrl":104},"templates\u002Freceive-basic.ts",1592,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Ftemplates\u002Freceive-basic.ts",{"path":106,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":107,"sourceHtmlUrl":108},"templates\u002Freceive-blocklist.ts",1794,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Ftemplates\u002Freceive-blocklist.ts",{"path":110,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":111,"sourceHtmlUrl":112},"templates\u002Freceive-reply.ts",2736,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Ftemplates\u002Freceive-reply.ts",{"path":114,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":115,"sourceHtmlUrl":116},"templates\u002Fsend-basic.ts",2154,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Ftemplates\u002Fsend-basic.ts",{"path":118,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":119,"sourceHtmlUrl":120},"templates\u002Fsend-notification.ts",4611,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Ftemplates\u002Fsend-notification.ts",{"path":122,"resourceType":123,"resourceTypeDesc":124,"sizeBytes":125,"sourceHtmlUrl":126},"templates\u002Fwrangler-email.jsonc","OTHER","其他",1824,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fcloudflare-email-routing\u002Fskills\u002Fcloudflare-email-routing\u002Ftemplates\u002Fwrangler-email.jsonc",[128,136,143,150,157,164],{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":132,"licenseFileUrl":6,"sourceHtmlUrl":133,"categories":134,"keywords":135,"publishedAt":19},"01M79G206MT3J6S0GY3C45P2KV","vss-summarize-video","Use to summarize a recorded video via the LVS summarization microservice (HITL-gated) with a VLM fallback. Not for report generation or live RTSP captioning.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-summarize-video\u002FSKILL.md",[],[],{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":132,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":19},"01M79G1WN63PGRE8CKD47WEBQ5","vss-setup-video-analytics-api","Use to deploy the vss-video-analytics-api REST service standalone (config-source, data-log bind, Elasticsearch, optional Kafka). Not for full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-video-analytics-api\u002FSKILL.md",[],[],{"skillNo":144,"name":145,"nameZh":6,"description":146,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":132,"licenseFileUrl":6,"sourceHtmlUrl":147,"categories":148,"keywords":149,"publishedAt":19},"01M79G1S9F7VY3EF6H53PRP5AN","vss-setup-behavior-analytics","Use to deploy the vss-behavior-analytics service standalone (entrypoint, config-source, optional calibration). Not for the full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-behavior-analytics\u002FSKILL.md",[],[],{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":132,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":19},"01M79G1N1S1Y27PFZPYMNK1MTQ","vss-search-archive","Use this skill to run top-level VSS fusion search on archived video, or to ingest video files \u002F RTSP streams for search. Do NOT use for ad-hoc visual Q&A (use vss-ask-video), live captioning (use vss-deploy-dense-captioning), or video summarization and reports (use vss-summarize-video).","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-search-archive\u002FSKILL.md",[],[],{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":132,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":19},"01M79G1H6WN0Q6C0VCAXCZX6B7","vss-query-analytics","Use this skill when reading video-analytics metrics, incidents, alerts, and sensor data via the VA-MCP server (port 9901). Not for live VLM or incident-range narrative reports.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-query-analytics\u002FSKILL.md",[],[],{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":132,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":19},"01M79G1DYPNXQS7QHZ0AAF5FX5","vss-manage-video-io-storage","Use to call the VIOS REST API (sensor list, timelines, clip extraction, snapshots, add\u002Fdelete sensors and streams). Not for VLM inference or search.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-manage-video-io-storage\u002FSKILL.md",[],[]]