Skip to content
Projects

About

多渠道临时邮箱聚合服务 — 统一 API、自动轮询、验证码提取

Systems & Infrastructure

How these counts are measured

Measured star growth

in 24h
0
in 7 days
+2
in 15 days
+6
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README_EN.md

Original

Mail Hub

Docker Pulls License

Multi-provider temporary email aggregation — unified API across 10+ email providers with auto-polling and verification code extraction.

中文 | API Docs

Features

  • 10+ Providers — unified REST API, no need to integrate each provider individually
  • Visible Dispatch Order — without an explicit provider, tries providers in the order you set (globally or per target service), skipping disabled/rate-limited/cooling ones; /api/dispatch/preview dry-runs it
  • Custom Providers — add REST or GraphQL providers via Web UI, zero coding
  • Code Extraction — auto-detect numeric, alphanumeric, and link-type verification codes
  • Outlook Retrieval — Second-level receive times, separate recipient and arrival-window attribution, bounded matching scans, explicit message-ID continuation, and administrator history paging
  • Recovery and Isolation — Recipient/lease isolation and retained template-account recovery after authentication failure
  • Pool Management — Outlook / YYDS Mail / IMAP domain email / iCloud aliases at scale
  • Access Control — API keys with admin/user tiers and daily quotas
  • Gmail Alias Generator — dot-trick / +suffix / googlemail.com variants
  • Web Admin Panel — dashboard, provider config, block table, system settings (Chinese/English)

Quick Start

Docker Compose (Recommended)

git clone https://github.com/ydddp/mail-hub.git
cd mail-hub
echo "API_SECRET=your-secret" > .env
docker compose up -d

Open http://localhost:3100 and log in with the API_SECRET from your .env.

Docker

docker run -d \
  --name mail-hub \
  -p 3100:3100 \
  -v ./data:/app/data \
  -e API_SECRET=your-secret \
  --restart unless-stopped \
  ghcr.io/ydddp/mail-hub:latest

Node.js (Development)

Requires Node.js 22+ (24 LTS recommended):

git clone https://github.com/ydddp/mail-hub.git
cd mail-hub
npm install
cp .env.example .env
# Edit .env, set API_SECRET
npm run dev

PM2 (Production)

npm install
npm run build
pm2 start ecosystem.config.cjs

Configuration

Variable Required Default Description
API_SECRET Recommended — Admin secret. Leave empty to grant admin to all requests (dev only)
PORT No 3100 Server port
HOST No 0.0.0.0 Listen address
DB_PATH No ./data/mail.db SQLite database path
PROXY_URL No — Outbound proxy, supports http/https/socks5

See .env.example.

Built-in Providers

Template Providers

Shipped as built-in templates. Enable, disable, edit, or delete from the Custom Providers page in the admin panel:

Provider Default Type Retention
Mail.tm ✅ REST Several days
Mail.gw ✅ REST 8 days
TempMail.lol ✅ REST 1 hour
TempMail.ing ✅ REST 10 min
Temp-Mail.io ✅ REST ~24 hours
Maildrop.cc ✅ GraphQL ~24 hours (publicly readable)
Catchmail.io ✅ REST 7 days
NiMail.cn ✅ REST 10 min
Guerrilla Mail ✅ REST 1 hour
Dropmail.me ❌ GraphQL 10 min. Get a free token at dropmail.me/api and replace PASTE_YOUR_TOKEN_HERE in apiBase, then enable

Deleting a built-in template only removes the DB row. It reappears on restart.

Hardcoded Providers

These are built into the code (not templates). Enable/disable, auto-dispatch participation and dispatch order are configured on the Provider Management page, with dedicated management UIs (sidebar entries):

Provider Type Description
Outlook Account Pool Import Outlook accounts with automatic Microsoft Graph, Outlook REST, or IMAP XOAUTH2 detection (including Thunderbird public OAuth tokens); complete missing authorization, 1:1 assignment, returned to pool on close; optional + sub-address alias; the account page separates recipient evidence from arrival windows and loads earlier mail
YYDS Mail API Key Pool Import keys, round-robin rotation, 20,000 calls/day per key
IMAP Domain Email Account Pool Connect your own domain via IMAP with catch-all; one mailbox backs many inboxes, with name-shaped generated addresses; leads the default dispatch order
iCloud Aliases Address pool Mints @icloud.com addresses through iCloud+ Hide My Email; they forward to your own mailbox and are sorted by recipient. Addresses are recycled, and a background task tops the pool up within Apple's rate limit

Custom Providers

Add any REST or GraphQL email provider via the Custom Providers page — no code changes needed:

  1. Click New Provider
  2. Choose a preset from the dropdown:
    • Two-step + Bearer — Mail.tm style (create account first, then exchange for token)
    • API Key Header — global auth header (e.g. X-Api-Key)
    • No Auth — details reused from list response
    • GraphQL POST + body — Dropmail style (single URL for all operations via {query: "..."})
  3. Fill in the form or edit the JSON directly
  4. Test Connection runs the full pipeline: getDomains → createInbox → getMessages → deleteInbox
  5. Save — takes effect immediately, no restart needed

Built-in Tools

Gmail Alias Generator (sidebar Gmail Alias): generates aliases via dot-trick, + suffix, and googlemail.com variants. All aliases deliver to the same inbox. Runs entirely in the browser. No configuration needed.

API Overview

All /api/* endpoints require a Bearer token:

Authorization: Bearer <your-api-secret-or-api-key>
# Create inbox
curl -X POST http://localhost:3100/api/inbox \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"for": "twitter.com"}'

# Create inbox with an alias address (e.g. [email protected])
# The tag is generated server-side; Outlook only, other providers ignore it
curl -X POST http://localhost:3100/api/inbox \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"for": "twitter.com", "alias": true}'

# With multiple Apple IDs, choose which one mints the address (iCloud only)
# Omit account to use the least-used address across all available accounts
curl -X POST http://localhost:3100/api/inbox \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"for": "twitter.com", "provider": "icloud", "account": "[email protected]"}'

# Get messages
curl http://localhost:3100/api/inbox/{id}/messages \
  -H "Authorization: Bearer YOUR_KEY"

# Extract verification code (with long-polling)
curl "http://localhost:3100/api/inbox/{id}/code?wait=true" \
  -H "Authorization: Bearer YOUR_KEY"

# Outlook: exclude returned IDs to retrieve another message, including equal timestamps
curl "http://localhost:3100/api/inbox/{id}/code?selection=matching&wait=true&excludeMessageId=message-123" \
  -H "Authorization: Bearer your-secret"

# Report result
curl -X POST http://localhost:3100/api/inbox/{id}/report \
  -H "Authorization: Bearer YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"success": true, "service": "twitter.com"}'

# Close inbox
curl -X DELETE http://localhost:3100/api/inbox/{id} \
  -H "Authorization: Bearer YOUR_KEY"

Typical workflow: Create → Extract code → Report → Close

Full API reference: docs/API.md AI/LLM integration: GET /v1/llms.txt (no auth required)

License

AGPL-3.0-or-later

Explore related projects

Loading…