Add subdomain inboxes — receive email on custom subdomains#10
Merged
Conversation
Subdomain owners can now create per-address inboxes (e.g., biden@craig.x402email.com) with optional forwarding and message retention for programmatic API access. Schema: SubdomainInbox + SubdomainMessage models, catchAllForwardTo on Subdomain Forward handler: routes subdomain recipients to matching inbox or catch-all DNS: MX record added to subdomain provisioning for inbound email 6 new endpoints: inbox create/list/delete, messages list/read/delete Plus subdomain/update for catch-all configuration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Convert inbox/create from free SIWX → x402 $0.25 payment - Forward handler skips retention when inbox hits 500 messages - Messages list and read endpoints return messageCount/messageLimit with warning when at >=80% or 100% capacity - Updated discovery + llms.txt with new pricing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…oint - Move 500 message cap + 100 inbox cap to SUBDOMAIN_INBOX_LIMITS in pricing.ts - Add POST /api/subdomain/inbox/update (SIWX, free) — change forwardTo and retainMessages after creation - Updated discovery + llms.txt Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Now that subdomain messages can share S3 keys with root inbox messages, the root delete path must check both tables before removing the S3 object. Also interpolate limits in create endpoint description string. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User Goal
Summary
biden@craig.x402email.com($0.25 x402, cap 100/subdomain)POST /api/subdomain/updatePricing rationale
$0.25/inbox covers ~1,250 forwarded emails at our SES cost (~3+ years of light use per inbox). 500 message cap prevents unbounded S3 growth. Agents get clear warnings via
messageCount/messageLimit/warningfields when they interact with their inbox.New Endpoints
POST /api/subdomain/inbox/createPOST /api/subdomain/inbox/listPOST /api/subdomain/inbox/deletePOST /api/subdomain/inbox/messagesPOST /api/subdomain/inbox/messages/readPOST /api/subdomain/inbox/messages/deletePOST /api/subdomain/updateChanges
SubdomainInbox+SubdomainMessagemodels,catchAllForwardToonSubdomain10 inbound-smtp.us-east-1.amazonaws.com)subdomainInboxCreate($0.25),subdomainInboxMessages($0.001)messageCount,messageLimit, andwarningwhen >=80% full.well-known/x402instructions +llms.txtupdated with all new endpointsManual Step (post-deploy)
Add
*.x402email.comas recipient condition to the existing SES receipt rule in AWS console. This enables SES to accept inbound email for all subdomains.Test plan
{subdomain: "craig", localPart: "biden"}→ success, costs $0.25biden@craig.x402email.com→ message retained in DBmessageCountandmessageLimitfields{subdomain: "craig", catchAllForwardTo: "catch@example.com"}→ email to unknown@craig forwardspnpm buildpasses🤖 Generated with Claude Code