Cloudflare Temp Email

repository·main·Indexed 27 days ago

https://github.com/dreamhunter2333/cloudflare_temp_email

A free temporary email service built on Cloudflare's serverless infrastructure. It features Rust-based email parsing via mail-parser-wasm, AI-driven data extraction using Cloudflare Workers AI, and a Vue 3 frontend. The system utilizes Cloudflare Workers, Pages, D1, KV, R2, and Email Routing, and includes an SMTP/IMAP proxy server and a dedicated skill for AI agents.

Tokens
49.2K
Snippets
102
Records
302
Agent score
94%

What's inside cloudflare_temp_email

  1. Overview of Cloudflare Temp Email Features

    main

    Cloudflare Temp Email is a high-performance, free temporary email service. Key capabilities include:

    • High-Performance Parsing: Uses Rust WASM (mail-parser-wasm) for fast and reliable email parsing.
    • AI-Powered Extraction: Utilizes Cloudflare Workers AI to automatically extract verification codes, authentication links, and service links from emails.
    • Security: Supports setting independent passwords for email addresses and includes CF Turnstile for human verification.
    • User Management: Features full registration/login, OAuth2 (GitHub, Authentik, etc.), and Passkey support.
    • Admin Capabilities: Includes a complete admin console for managing users, creating prefix-less emails, and configuring cleanup policies.
    • Integrations: Supports Telegram Bot/push notifications, Webhooks, and an SMTP proxy server for IMAP/SMTP access.
    • Agent Friendly: Includes a built-in skill (cf-temp-mail-agent-mail) designed for AI agents to consume email data directly.
  2. Overview of Cloudflare 一時メール

    main

    Cloudflare 一時メール is a feature-rich, free temporary email service built on Cloudflare's infrastructure. It is designed for high performance using Rust WASM for email parsing and offers a modern, multi-language responsive UI.

    Key capabilities include:

    • High Performance: Uses Rust WASM for extremely fast and reliable email parsing.
    • AI-Powered: Utilizes Cloudflare Workers AI to automatically extract important information like verification codes and authentication links from emails.
    • Security: Supports individual passwords for email addresses, OAuth2 (GitHub, Authentik), and Passkey-based passwordless login.
    • Agent Friendly: Includes a built-in skill (cf-temp-mail-agent-mail) allowing AI agents to interact directly with mailboxes.
    • Extensibility: Supports Telegram Bot integration, Webhooks, and an SMTP proxy server for SMTP sending and IMAP viewing.
    • Mobile Support: Compatible with the community-built CloudMail Android client.
  3. Overview of Cloudflare Temporary Email features

    main

    Cloudflare Temporary Email allows you to build a free temporary email service using Cloudflare. Key capabilities include:

    • Private Deployment: Deploy using only a domain name with free hosting on Cloudflare. Features include password-protected mailboxes, user registration, and attachment support.
    • High-Performance Email Parsing: Uses Rust WASM for extremely fast email parsing that supports various RFC standards and attachments.
    • Notifications & Integration: Supports forwarding emails to Telegram or via Webhooks. The Telegram Bot includes mailbox binding, email viewing, and a Telegram Mini App.
    • Email Sending: Supports sending text or HTML emails via UI, API, or SMTP, with DKIM signature support.
  4. Technical Architecture and System Configuration

    main

    The project is built on the Cloudflare ecosystem using the following architecture:

    System Configuration

    • Database: Cloudflare D1
    • Frontend Deployment: Cloudflare Pages
    • Backend Deployment: Cloudflare Workers
    • Email Routing: Cloudflare Email Routing

    Technology Stack

    • Frontend: Vue 3 + Vite + TypeScript
    • Backend: TypeScript + Cloudflare Workers
    • Mail Parsing: Rust WASM (mail-parser-wasm)
    • Database: Cloudflare D1 (SQLite)
    • Storage: Cloudflare KV + R2 (or S3)
    • Proxy Service: Python SMTP/IMAP Proxy Server

    Key Components

    • Worker: Core backend service
    • Frontend: Vue 3 user interface
    • Mail Parser WASM: Rust email parsing module
    • SMTP Proxy Server: Python email proxy service
    • Pages Functions: Cloudflare Pages middleware
    • Documentation: VitePress documentation site
  5. Quickstart Deployment Guide

    main

    To deploy the Cloudflare 一時メール service, you can use the official documentation or the GitHub Actions deployment guide.

    For a quick deployment to Cloudflare Workers, use the provided deployment button which directs you to the Cloudflare Workers setup process.

  6. Configure S3 Attachments for email attachments

    main

    To enable saving and downloading email attachments via S3 (or Cloudflare R2), you must configure an S3-compatible storage bucket and set the corresponding credentials as secrets in your Cloudflare Worker.

    1. Create a Bucket: Create a bucket in Cloudflare R2 or another S3-compatible service.
    2. Configure CORS: Ensure your R2 bucket has the correct CORS policies configured via the Cloudflare dashboard.
    3. Generate Credentials: Obtain your ENDPOINT, Access Key ID, and Secret Access Key using Cloudflare R2 S3 tokens.
    4. Set Secrets: Add the credentials to your Cloudflare Worker environment using wrangler secret put.
    cd worker
    pnpm wrangler secret put S3_ENDPOINT
    pnpm wrangler secret put S3_ACCESS_KEY_ID
    pnpm wrangler secret put S3_SECRET_ACCESS_KEY
    # Note: Replace bucket with your bucket name
    pnpm wrangler secret put S3_BUCKET
  7. Manually Configure the Frontend Zip Package

    main

    If you prefer not to use the web generator, you can manually configure the frontend assets:

    1. Download the base package: frontend.zip.
    2. Extract the archive and locate the file named index-xxx.js (where xxx is a random string) inside the assets folder.
    3. Open this file and search for the placeholder string: https://temp-email-api.xxx.xxx.
    4. Replace that string with your actual backend API root URL (e.g., https://temp-email-api.example.com).
    5. Re-zip the files and upload the new package to Cloudflare Pages.

    Troubleshooting:

    • If you see Cannot read properties of undefined (reading 'map') or 405 Method Not Allowed, you likely entered your frontend domain instead of your backend API domain, or included a trailing slash/path.
    • If errors persist after a redeploy, clear your browser cache or test in an incognito window to ensure old assets are not being served.
  8. Configure Workers AI Binding

    main

    To use the full AI extraction capabilities (including link extraction), you must provide a Workers AI binding to your Cloudflare Worker.

    Option 1: via wrangler.toml Add the following configuration:

    [ai]
    binding = "AI"

    Option 2: via Cloudflare Dashboard In your Worker settings, add a variable with:

    • Variable name: AI
    • Type: Workers AI

    Fallback Behavior: If ENABLE_AI_EMAIL_EXTRACT is enabled but no AI binding is found, the system falls back to a built-in regex extractor. This fallback only extracts verification codes (auth_code) and does not extract links.