📧 Email Relay Service

Mailgunwebhook → Resendwebhook → HostingerIMAP poll → HALT 503

Inbound — Webhook endpoint

POST/webhook/resend
Register this URL in Resend → Webhooks → Add Endpoint. Verifies svix signature.

Inbox

GET/inbox
List emails. Query: ?to=user@domain.com &provider=mailgun &limit=20
GET/inbox/latest
Latest email full content. Query: ?to=user@domain.com
GET/inbox/otp
âš¡ Extract OTP from latest email. Works with TikTok, Facebook, Google, WhatsApp, etc.
curl http://localhost:3000/inbox/otp?to=user@yourdomain.com
# → { "found": true, "code": "120351", "confidence": "high" }
GET/inbox/:id
Full email by ID
DELETE/inbox/:id
Delete email by ID

System

GET/status
Provider states, IMAP poller status, daily/monthly counters
POST/admin/reset/:provider
Reset provider counters. :provider = mailgun | resend | hostinger
GET/health
Health check