How sums001/openinbox works
OpenInbox is a self-hosted business-email application on Cloudflare. A user opens the web client, completes setup and authentication, then manages mail and administration through the client’s same-origin API; the Worker handles API requests and scheduled or mail-related work. The README also documents inbound routing, outbound provider failover, domain/DNS setup, security, and optional attachment storage. The graph preserves these product stages, but several runtime links are documented only at a high level because their implementation files were not sampled.
Main entry points: App.tsx Application shell · app.ts API router · api.ts API client · mail Mail client
Components 22
Web client
- Application shell
src/web/App.tsx - API client
src/web/lib/api.ts - Sign-in and recovery
src/web/pages/auth
Mail workflows
- Mail client
src/web/pages/mail - Message rendering safety
src/web/lib/sanitize.ts
Setup and administration
- Admin console
src/web/pages/admin - Setup wizard
src/web/pages/setup/SetupPage.tsx - User settings
src/web/pages/settings
Worker services
- API router
src/worker/app.ts - Session security
src/worker/auth/session.ts - Instance and domain setup
src/worker/services/setup.ts - Mail API routes
src/worker/routes/mail.ts - Compose routes
src/worker/routes/compose.ts - Inbound processing
src/worker/services/inbound.ts - Outbound delivery
src/worker/services/send.ts - Delivery webhooks
src/worker/services/webhooks.ts
Cloudflare and storage
- D1 database
src/worker/db/db.ts - Attachment storage
src/worker/storage/r2.ts - Cloudflare API
- Email Routing
- Sending providers
src/worker/providers/index.ts
Other components
- Mailbox user
Connections 27
- Mailbox user → Application shell: uses
README.md - Application shell → Sign-in and recovery: routes to
src/web/App.tsx - Application shell → Setup wizard: routes to
src/web/App.tsx - Application shell → Mail client: routes to
src/web/App.tsx - Application shell → Admin console: routes to
src/web/App.tsx - Application shell → User settings: routes to
src/web/App.tsx - Mail client → Message rendering safety: uses
src/web/pages/mail/ThreadView.tsx - Sign-in and recovery → API client: requests
- Mail client → API client: requests
src/web/pages/mail/ThreadView.tsx - Admin console → API client: requests
- Setup wizard → API client: requests
src/web/pages/setup/SetupPage.tsx - User settings → API client: requests
src/web/pages/settings/MailboxSettings.tsx - API client → API router: calls API
src/web/lib/api.ts - API router → Session security: loads session
src/worker/app.ts - API router → Instance and domain setup: routes setup
- API router → Mail API routes: routes mail
src/worker/app.ts - API router → Compose routes: routes compose
src/worker/app.ts - Email Routing → Inbound processing: hands off mail
README.md - Inbound processing → D1 database: stores messages
- Outbound delivery → Sending providers: delivers through
- Sending providers → Mailbox user: delivers mail
- Delivery webhooks → D1 database: updates delivery state
src/worker/services/webhooks.ts - Instance and domain setup → Cloudflare API: configures domains
README.md - Cloudflare API → Email Routing: configures routing
README.md - Inbound processing → Attachment storage: stores large attachments
- API router → D1 database: uses D1
README.md - Mailbox user → Admin console: administers instance
README.md