Every email (API, SMTP proxy, campaigns, scheduled) now passes one send
gate in the queue worker right after the limit check:
- ContentScreeningService: extracts all links (href/src/action, bare URLs,
redirect/tracking-wrapped targets) and checks them against a threat-feed
host index (default: Phishing.Database active phishing domains, MIT),
stored in Redis as a ~3 MB sorted hash index and refreshed every 6h by
a BullMQ job. Shared platforms are exempt from feed matches.
- In-process heuristics: blocked attachment types (.exe/.js/.scr/.iso/...),
raw-IP links, URL shorteners, link-text/href domain mismatch,
javascript:/data: links, base64-only bodies, missing unsubscribe on
marketing mail, phishing/crypto/gift-card language, caps, hidden text.
- Verdicts: allow / hold / reject. Rejections return a clear 400 on the
API/SMTP path and refuse campaigns at schedule time; malicious rejects
are strikes and 3 in 7 days block the team.
- First-sends review: new cloud teams' emails are HELD until 20 sent and
48h old (configurable in sending-policy.ts / env), unless verified or
trusted (Team.sendingTrustedAt).
- New EmailStatus HELD + EmailReview table; customers see HELD in logs
and GET /v1/emails/{id} (latestStatus); admin is emailed (rate-limited).
- Admin > Review (/admin/review, adminReview tRPC router): sandboxed
CSP-locked preview, approve / approve and trust / approve team / reject
(note) / reject and block team.
- Cleanup job keeps bodies of HELD emails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Plans FREE / PRO ($20, 50k/mo, 10 domains) / SCALE ($90, 100k/mo,
1,000 domains) with $0.90 per 1,000 overage, defined once in
packages/lib/src/constants/pricing.ts and used by PLAN_LIMITS, the
billing UI and the marketing pricing section
- Dodo checkout sessions, customer portal, prorated plan change,
cancel/resume at period end (official dodopayments SDK)
- /api/webhook/dodo verified with Standard Webhooks via SDK unwrap();
idempotent per webhook-id (BillingWebhookEvent claim and billing writes
in one transaction); handles subscription active/renewed/plan_changed/
on_hold/cancelled/failed/expired and payment succeeded/failed; ignores
other products on the shared Dodo business
- Usage job ingests daily sent-email counts as Dodo usage events with
deterministic ids (team + day), 3-day catch-up, 1,000-event batches
- Migration: Plan BASIC -> PRO, add SCALE; Team.stripeCustomerId ->
billingCustomerId; provider-neutral Subscription (provider, customerId,
plan, productId/productIds)
- Remove stripe package, Stripe route and STRIPE_* env; add DODO_* env,
compose/.env.example entries and owner steps in deploy/DEPLOY.md
- Billing UI degrades to "Billing not configured" without keys
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- rename product to Scribase Mail across web app, emails, marketing and docs
- new monochrome mark/favicons and neutral black/white theme; remove emoji UI
- source code link (AGPL-3.0) in sidebar, login and unsubscribe pages
- rewrite marketing site and self-hosting docs for OCI Email Delivery,
add OCI notes page (event sources, unavailable features)
- add NOTICE and MERGE.md crediting useSend and listing changes
- add deploy/compose.scribase-mail.yml (web+postgres+redis, 1.47 GB limits),
deploy/.env.example, Caddy site and DEPLOY.md for mail.scribase.com
- replace legacy provider env vars in turbo.json, CI, env examples, docker files
- OCI SDK packages as server externals for the standalone build
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- add provider interface (apps/web/src/server/provider) and OCI implementation:
SMTP sending via nodemailer, email domains + DKIM (CNAME), approved senders,
suppression list API, provider status
- poll the OCI suppression list for bounces/complaints and feed them through
the shared email event pipeline (no push notifications)
- first-party open/click tracking with signed pixel and redirect URLs
- replace SES settings with auto-created ProviderSetting + Email provider page
- image uploads via OCI Object Storage pre-authenticated requests
- squash Prisma migrations into a single provider-neutral baseline
- remove all legacy provider SDK packages
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>