Documentation Index
Fetch the complete documentation index at: https://docs.tuturuuu.com/llms.txt
Use this file to discover all available pages before exploring further.
apps/mail is the standalone Tuturuuu mailbox app. It runs on https://mail.tuturuuu.com in production and port 7820 locally, delegates auth to apps/web, and only admits exact @tuturuuu.com accounts. Addresses such as @xwf.tuturuuu.com are intentionally denied.
Architecture
apps/mailowns the mailbox UI and proxies/api/*toapps/web.apps/webowns all protected mail APIs under/api/v1/workspaces/:wsId/mail/*.- The mailbox mirror is stored in
private.mail_*tables and is service-role only. App pages and route handlers must authorize exact-domain users and mailbox membership before returning data. - Outbound messages use
@tuturuuu/email-servicewith the selected mailbox address as the source. - Inbound messages use SES Email Receiving with S3 raw-message storage and SNS notifications. The webhook stores an idempotent inbound job, fetches raw MIME from S3, mirrors sanitized bodies and attachment metadata, and quarantines unknown recipients.
SES Receiving Setup
Do not change DNS from code or migrations. The current public MX fortuturuuu.com is Google-routed, so real @tuturuuu.com receiving requires an explicit staged MX cutover or a pilot subdomain first.
- Verify the domain or pilot subdomain in the SES receiving region.
- Create an S3 bucket for raw MIME objects.
- Create an SNS topic for receipt notifications and subscribe the web webhook:
POST /api/v1/webhooks/mail/ses. - Create an SES receipt rule that stores raw MIME in S3 and publishes the SNS notification.
- Configure
MAIL_SES_INBOUND_TOPIC_ARN,MAIL_SES_INBOUND_BUCKET,MAIL_SES_INBOUND_KEY_PREFIX, andMAIL_SES_REGION. - Only after validation, stage the MX/DNS change outside the app repository.
MAIL_SES_SNS_SIGNATURE_VERIFICATION=disabled. Do not use that setting in production.
Operations
- Run
bun sb:uplocally after mail schema changes, thenbun sb:typegen. - Keep new mail route access checks in
apps/web; do not add direct client Supabase reads inapps/mail. - Use
packages/internal-api/src/mail.tsfor client helpers and TanStack Query in the app UI. - Unknown inbound recipients are retained as
quarantinedjobs for administrator review instead of being delivered to a user inbox.