11 Commits

Author SHA1 Message Date
b937f4e0e2 feat(geo): add llms.txt/robots.txt/IndexNow key to toolgate + mail hosts
Closes the "Not done" item from plans/gtm/geo-2026-11-12/README.md: neither
toolgate.scribase.com nor mail.scribase.com served the IndexNow key file,
and mail.scribase.com had no llms.txt/robots.txt at all.

- apps/toolgate: toolgate.scribase.com already served llms.txt/robots.txt;
  added the missing GET /7f3f677310caeed6257f96d8c72c8a0c.txt IndexNow key
  route (same key already live on scribase.com/docs.scribase.com).
- apps/mail: added GET /llms.txt, /robots.txt and the same IndexNow key
  route to mail-server's public router (mail.scribase.com had none).

Verified locally: cargo build -p switchyard-server and -p mail-server both
clean. Deployed for real (not under the *.ereboslab.com freeze): rebuilt
and recreated both containers (railyard-box for toolgate, box1 for mail),
curl-verified all new routes live and 200 on both public hosts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-16 15:22:29 +03:00
2cb13e2fd6 feat(mail): SMTP submission live on smtp.scribase.com — docs no longer 'soon', banner default smtp.scribase.com
Hosted SMTP submission (587 STARTTLS / 465 TLS, AUTH user scribase + API key)
is live on box1 behind a Let's Encrypt cert. Docs: Supabase custom SMTP
method marked live, API reference SMTP section expanded (From rules, 250 id,
550 on content block). mail-submit default SUBMIT_HOSTNAME -> smtp.scribase.com.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-13 15:51:49 +03:00
830e75702a docs(mail): match the live server — plans from /billing/plans, SDK and SMTP marked not yet live, no open-source claim
- limits-pricing, index, migrate-from-resend: Free 3,000/mo, Pro $20 then
  $0.80/1k, Scale $90 for 150,000 then $0.60/1k (the live GET /billing/plans);
  pay-as-you-go, auth-email allowance and Mail Studio grandfathering lines
  removed (not implemented).
- sdk-typescript + quickstart: @scribase/mail is not on npm, marked {soon}.
- test-mode: SMTP submission marked {soon}; "open source (MIT)" and
  "your own install" removed (the source is not published); local dev =
  sk_test_ key against the hosted API.
- build.mjs default base URL -> https://scribase.com/mail/docs/ (published
  there from the scribase www repo, commit 77f1469).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 14:36:25 +03:00
ccb966b4d8 feat(mail): box1 deploy — Dockerfile, fixed relay envelope sender, key parsing + Dodo webhook hardening
- apps/mail/Dockerfile + .dockerignore: rust:1-bookworm build -> debian slim runtime
  (pure rustls, only ca-certificates), dashboard baked in at /app/dashboard
- RELAY_RETURN_PATH: fixed MAIL FROM for relays that only accept approved senders
  (OCI Email Delivery approves exact addresses, so per-email VERP is rejected);
  test mode keeps VERP so the simulated transport still recovers the email id
- mail-auth keys: try hex first — 64 hex chars are also valid standard base64
  (48 bytes), which made AUTH_SIGNING_KEY=<hex> fail at boot
- Dodo webhook: an account_id from checkout metadata that does not exist is now
  ignored (200) instead of failing on the customer FK (500 + endless retries)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 14:03:39 +03:00
70653ae53b feat(mail): mount the dashboard, email event + webhook delivery logs, billing shape, friendly bad magic links
mail-server serves apps/mail/dashboard at /dashboard/ (tower-http fs,
DASHBOARD_DIR, mock/ and MOUNT.md never served). New account-scoped,
Resend-shaped endpoints the dashboard reads: GET /emails/{id}/events
(status history with timestamps and a one-line detail from the stored
payload), GET /emails/{id}/webhook-deliveries and
GET /webhooks/{id}/deliveries (delivery log joined with event + endpoint),
GET /emails?test=true|false and GET /suppressions?q= server filters.
GET /billing now carries description, next_plan, upgrade_label,
current_period_end/renews_at; POST /billing/checkout accepts success_url
(own origin only) and returns url. mail-auth: a bad, used or expired link
opened in a browser redirects to <redirect_to>#error=invalid_token (or a
plain HTML page when the token was never ours); the dashboard shows the
message on the login form. Dashboard uses the server-side test filter,
portal via POST /billing/portal, docs updated.

Verified live against local Postgres mail_e2e + fake relay + webhook
listener: curl of every endpoint (404 for another account's ids, 401
without auth, 422 on test=maybe), and a headless-browser pass through the
real magic-link login, email timeline, webhook delivery log, usage card
and the expired-link redirect.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 13:01:01 +03:00
c6a84e090b fix(mail): report overage to the existing live Dodo meter (scribase_mail.email.sent)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 04:49:32 +03:00
a154a99bfb feat(mail): plans + Dodo billing (test mode) and abuse controls
- Plans in a table (free/pro/scale), quotas enforced on API, SMTP and Supabase hook paths; test sends never count
- GET /billing, checkout + portal via Dodo, signed Dodo webhooks, idempotent overage metering
- Sandbox tier for new accounts, domain warm-up, auto-pause on bounce >4% / complaint >0.08%
- Content checks: executables, brand impersonation, lookalike domains, credential harvest, Spamhaus DBL
- Disposable-email and per-IP signup throttles; admin endpoints behind ADMIN_API_KEY

Verified against the real server locally with a fake relay and mock Dodo (proof table in plans/scribase-mail-rust-2026-11-12.md).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 04:38:55 +03:00
2299eb1ba5 feat(mail): customer dashboard (no-build HTML + vanilla JS)
Login via our own magic links, 3-step onboarding (domain, DNS records, first send),
emails with status timeline, domains, API keys (live/test), webhooks, suppressions,
team, usage + plan. Live/Test switch everywhere. Dev mock server + MOUNT.md listing
the one-line axum mount and missing API pieces. Verified in a headless browser
against the mock (24 screenshots).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 04:24:04 +03:00
219a58e855 feat(mail): wire one mail-server process — relay pool default, SMTP submit, Supabase hook, inbound ingest, OCI onboarding
- mail-server spawns SMTP submission + HTTPS inbound ingest, mounts Supabase hook router
- RelayPool is the default transport; relay rejections mark email failed without suppressing recipient
- inbound DSN/ARF -> bounced/complained + suppression + webhooks
- domains API returns Resend-style records incl. OCI DKIM; OCI onboarding gated by OCI_ONBOARDING=on
- OCI suppression mirror sync; docs: test mode uses sk_test_

Verified end to end locally against a fake relay (API + SMTP send, DKIM valid, bounce -> suppressed -> 403, complaint, Supabase hook, 7 signed webhooks).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 01:42:48 +03:00
173b60097d feat(mail): OCI relay pool, direct MTA (parked), inbound HTTPS ingest, Cloudflare inbound forwarder
- mail-oci: OCI Email Delivery client (signed REST), per-customer domain/DKIM/sender onboarding, suppression mirror, sending limits
- mail-mta: RelayPool transport with OCI primary, optional secondary, health/back-off/quota failover; direct MTA kept but off
- mail-inbound: DSN/ARF/DMARC/TLS-RPT parsing + HMAC-signed POST /inbound/raw ingest (no port 25)
- workers/inbound-forwarder: Cloudflare Email Routing worker forwarding raw mail over HTTPS

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 01:14:52 +03:00
9429ff20da feat(mail): Scribase Mail Rust platform: sending core, accounts, auth, SMTP submission, Supabase hook, deliverability, TS SDK, docs
Clean-room Rust rewrite (written without reference to useSend source).
Crates: mail-types, mail-core, mail-server, mail-auth, mail-submit,
mail-hooks, mail-deliverability; sdks/ts (@scribase/mail); docs/.
Each verified by running locally (see plans/scribase-mail-rust-2026-11-12.md).
mail-mta, mail-inbound, mail-oci are still in progress and not in this commit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-13 01:03:09 +03:00