caelum0x 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
..

mail-submit

SMTP submission for Scribase Mail. Point any SMTP client (Supabase Auth, nodemailer, Rails, Django, WordPress, a printer) at us and the message goes through the same pipeline as POST /emails: DKIM signing, suppression list, tracking, webhooks, metering and logs. Accepted mail is tagged source=smtp.

Independent implementation, written without reference to useSend or Stalwart server source. Licence: MIT.

Settings to give users

Field Value
Host smtp.scribase.com
Port 587 (STARTTLS) or 465 (TLS)
Username scribase (resend also works, for migrations)
Password an sk_ API key
From an address on one of the account's verified domains

Protocol

  • RFC 5321/6409 submission with PIPELINING, SIZE, 8BITMIME, SMTPUTF8, ENHANCEDSTATUSCODES, STARTTLS (RFC 3207), AUTH PLAIN and AUTH LOGIN (RFC 4954/4616). Commands are parsed with smtp-proto (MIT OR Apache-2.0).
  • AUTH is only advertised and accepted after TLS; before it, 530 5.7.0 Must issue a STARTTLS command first.
  • The password is verified exactly like Authorization: Bearer on the HTTP API (SHA-256 lookup among non-revoked keys). sk_test_ keys work too.
  • MAIL FROM and the From: header must be on a domain registered to the key's account and verified (or the key's domain restriction). Otherwise 550 5.7.1. Null sender is refused (553 5.1.8).
  • Unauthenticated MAIL/RCPT/DATA get 530 5.7.0 Authentication required: this is never an open relay.
  • Limits: SIZE (default 25 MB) enforced at MAIL FROM and while reading DATA (552 5.3.4), max recipients (452 4.5.3), per-IP concurrent connections and connection rate (421 4.7.0), and auth-failure lockout: after SUBMIT_AUTH_FAILURES (default 5) bad passwords an IP gets 421 4.7.0 Too many failed authentication attempts and is refused for SUBMIT_AUTH_LOCKOUT_SECS (default 15 min).
  • On DATA the message is parsed with mail-parser. From/To/Cc/Reply-To/ Subject and the bodies and attachments are mapped onto a SendRequest; every other header (X-*, In-Reply-To, References, List-Id, ...) is forwarded. The envelope decides delivery: RCPT TO addresses not in To:/Cc: become Bcc; header-only addresses are not delivered to.
  • Success: 250 2.0.0 Ok <email_id> where <email_id> is the id you can GET /emails/{id}.

Run

openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365 -subj /CN=localhost
export DATABASE_URL=postgres://localhost/mail_dev_core      # same DB as mail-server (run it first)
export SUBMIT_TLS_CERT=cert.pem SUBMIT_TLS_KEY=key.pem
export SUBMIT_STARTTLS_ADDR=127.0.0.1:5870 SUBMIT_TLS_ADDR=127.0.0.1:4650
export DEV_TRUST_UNVERIFIED_DOMAINS=on                      # dev only
cargo run -p mail-submit

All variables: src/config.rs. mail-server owns migrations and the delivery workers; this process only authenticates and enqueues. To embed it, call mail_submit::serve(SubmitConfig, CoreDeps { store, cfg }).

What happens to the message

Since 2026-11-13 submissions go through mail_core::enqueue_raw: the bytes are queued verbatim and the worker only adds our DKIM signature. The client's Message-ID, To:/Cc: (including header-only addresses), In-Reply-To, References, List-* and any X-* headers are kept. We remove Bcc, Return-Path, Received, Delivered-To, X-Original-To, DKIM-Signature, ARC-*, Authentication-Results and X-Scribase-Source, and add Date / Message-ID when missing (RFC 6409 §8). The email is tagged source=smtp. Authentication uses mail_core::authenticate_api_key, the same lookup as Authorization: Bearer.

Known gaps

  • No CHUNKING/BDAT, no DSN parameters.