Adds the forward action for inbound mail across all three surfaces, picking
up the top-ranked item left in PLAN-2026-10-23-DEEP.md after round 2's
reply work:
- forwardReceivedEmail() (received-email-service.ts): builds a
Gmail-style "Forwarded message" header block + optional comment,
prepended to the original text/html, and reuses the original
attachments by reading their bytes straight from inbound storage
(new getStorageObjectBytes() in inbound-storage-service.ts) instead of
re-uploading them, before handing off to the existing sendEmail
pipeline (same quota/screening/suppression checks as send/reply).
- POST /emails/received/:id/forward on the Resend-compat public API and
receivedEmail.forward on the dashboard tRPC router, both thin wrappers
over the same service so behavior is identical everywhere.
- MCP tool forward_received_email, completing the reply/forward loop for
AI-agent callers.
- Dashboard ForwardComposer UI (recipient input + optional note),
toggled by a header-bar Forward icon next to Reply.
Verified via typecheck, eslint (0 errors), targeted vitest (both existing
suites still pass unmodified), and `pnpm build` for packages/mcp-server.
No migration, no new test files, per standing rules.
Inbound MX server now captures the full forwardable header chain
(extractForwardedHeaders, reused from the outbound submission proxy) and
persists it on ReceivedEmail.headers (no migration, already Json?).
replyToReceivedEmail builds the real RFC 5322 References chain from it
instead of only the immediate message's own Message-ID, so a reply to a
reply-of-a-reply now threads correctly beyond one hop.
Also exposes reply on the two surfaces that were dashboard-only: a new
POST /emails/received/:id/reply on the public Resend-compat API, and an
MCP tool reply_to_received_email wired to it, so external SDK callers and
AI agents can reply too.
Also records two untracked planning docs (architecture, competitive/GTM
strategy) written earlier this session, and updates the build log/plan
doc with round 2 progress and the revised priority order.
Paragraph and heading nodes store their alignment under textAlign; button
and logo nodes used a bespoke alignment attribute instead, flagged with two
`@TODO: Update the attribute to textAlign` comments in renderer.tsx. Any
content built or imported using the rest of the editor's own textAlign
convention (e.g. programmatic template generation) would have its button/
logo alignment silently ignored and fall back to the hardcoded default.
Both render methods now prefer attrs.textAlign and fall back to the legacy
attrs.alignment, so older saved templates keep rendering exactly as before
while new/imported content can use the same attribute name as every other
aligned node. Only renderer.tsx changes - the Tiptap node schemas
(ButtonExtension, etc.) still read/write `alignment` for the live editor UI,
so there is no risk of the editor dropping an old template's alignment on
load.
Added 5 renderer tests (apps/web/src/lib/email-editor-node-alignment.unit.test.ts,
the only place in this repo with test infra for the EmailRenderer, matching
the existing campaign.unit.test.ts pattern) covering textAlign, legacy
alignment, and the default for both node types.
Closes#2.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Nine console.log/console.error calls left over from development were still
running in production, including two with real impact:
button.tsx's ButtonComponent logged its entire NodeViewProps object on every
render of every button block in the email editor (hot path, large object);
login-page.tsx logged the user's email to the browser console on every OTP
submit. The rest (instrumentation startup, to-html render timing/errors,
drag-and-drop clipboard serialization, image upload progress, variable
autocomplete) were pure dev leftovers with no guard. Routed the two
server-side ones (instrumentation.ts, to-html/route.ts) through the existing
shared logger instead of dropping them, since they carry real operational
signal (startup confirmation, render latency/failures); the rest were purely
debug noise and are just removed.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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>
* feat: add customizable contact double opt-in flow
* test: add double opt-in service coverage
* fix: address review comments for double opt-in PR
- Make pending status conditional on doubleOptInEnabled flag
- Backfill legacy unsubscribeReason for reliable pending detection
- Add doubleOptInContent to contact book listing select
- Fix duplicate toast on DOI editor subject save failure
- Harden searchParams parsing against string[] values
- Make default DOI template use link mark for clickable URL
- Make public API create+update atomic via transaction
- Prevent contact upsert failure when DOI email send fails
- Fix empty string template variable replacement
Co-authored-by: opencode <opencode@anthropic.com>
* fix: harden double opt-in confirmation safeguards
Preserve explicit unsubscribe intent in DOI flows and prevent confirmation links from re-subscribing opted-out contacts. Also sanitize subscribe-page error messaging and use timing-safe hash comparison for link verification.
* ui stuff
* fix: require doubleOptInUrl in double opt-in templates
* feat: add configurable from address for double opt-in emails
* feat: add resend confirmation flow for pending contacts
* fix: move subscribe confirmation to explicit POST flow
* test: add contact book public API endpoint coverage
* docs: add double opt-in documentation and update OpenAPI spec
Add a user guide for the double opt-in feature covering setup, contact
statuses, email customization, template variables, and best practices.
Update the OpenAPI spec to include doubleOptIn fields in all contactBook
request/response schemas.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: opencode <opencode@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat(python-sdk): add webhook verification and event handling
Add webhook support to the Python SDK matching the JS SDK implementation:
- Add Webhooks class with verify() and construct_event() methods
- Implement HMAC-SHA256 signature verification with timing-safe comparison
- Add timestamp validation with configurable tolerance (default 5 minutes)
- Add comprehensive webhook event types (18 events: email, contact, domain, test)
- Add WebhookVerificationError with typed error codes
- Export webhook constants (headers) and types
* fix(python-sdk): harden webhook parsing and typing
Normalize invalid UTF-8 webhook payloads to INVALID_BODY errors so verify() safely returns false, and narrow base email webhook event types to avoid discriminated-union overlap. Add regression tests for both paths.
* chore(python-sdk): bump package version to 0.2.9
* feat(python-sdk): add local webhook test example project
Add a runnable Flask receiver and signed webhook sender under packages/python-sdk/example, and link it from the Python SDK README for local verification.
---------
Co-authored-by: Claude <noreply@anthropic.com>