v1.0.1 · Rust core · Node, Bun, Deno
Email infrastructure, engineered for efficiency, reliability, precision and simplicity.
A Rust core, a Node-API addon and a typed SDK. One transport that queues, pools its sessions, and reports exactly what the relay said.
The native addon ships per platform, with no Rust toolchain and no build step on your side.
- 7 native targets, one install
- 32 maximum concurrent sends
- 120 s bounded total send budget
- 100 recipients per message
Install
Section titled “Install”Two commands, and the native addon comes with the package. No Rust toolchain, no build step, no postinstall download on your side.
npm install @sendust/tspnpm add @sendust/tsyarn add @sendust/tsbun add @sendust/tsEfficiency is an engineering decision, not a marketing slogan.
The SMTP engine, MIME composition and address validation are Rust, compiled per platform and reached through one Node-API bridge. No worker process, no JavaScript sitting between your call and the socket. The architecture overview says where each responsibility sits.
What the engine does
Section titled “What the engine does”- Queue and pool Concurrent send() calls are scheduled: up to delivery.maxConcurrent at once over at most delivery.maxConnections sessions, one SMTP transaction per session. A full queue is LIMIT_QUEUE_FULL, not unbounded memory.
- Sessions stay warm A definitive outcome resets the session and keeps it, up to delivery.maxMessagesPerSession messages or delivery.sessionIdleMs idle. An error or an unknown disposition drops it.
- Acceptance, not delivery accepted means the relay took responsibility. There is no delivered, opened or bounced status, and the library never retries unknown on its own.
- Signed at the client Optional DKIM: rsa-sha256 with relaxed/relaxed canonicalization, signed on the composed bytes before DATA, with the body hashed in full. The key is parsed at createTransport, so an unusable one fails before any connection.
The journey of one send
Six stops between your call and the relay's answer
Each stop below is a stage the engine really has. Pick one to read what happens inside it, or walk the whole run.
Options settled before any socket exists
The caller names the relay, the TLS mode, the auth, the budgets and the caps. Timeout ordering is checked here: the connect and operation budgets may not exceed the total, and the close budget may not sit under it. A configuration that cannot work fails now, not after a socket exists.
- TLS or STARTTLS, both verified
- connect 10 s, operation 30 s, total 120 s
- close drain 125 s
Queued, not tunnelled
A send is queued. A transport runs up to delivery.maxConcurrent sends at once over at most delivery.maxConnections native sessions, and each session runs one SMTP transaction at a time. Concurrency starts at one and grows after sustained success.
- one message per send()
- a full queue rejects with LIMIT_QUEUE_FULL
- nothing is silently dropped
The call crosses as owned memory
The operation is handed across the native boundary as owned memory: every buffer and string is copied before the work is scheduled, so nothing borrows JavaScript memory once send() has returned.
- crates/sendust-napi
- async work on the Tokio runtime
- JS values are copied in, then owned
Validate, compose, enforce the caps
Validation runs in a deterministic order, the MIME message is composed, and the hard caps are enforced before the wire: 100 recipients, 10 MiB per attachment, 20 MiB across attachments, 30 MiB serialized.
- crates/sendust-core
- validation, MIME, caps
- the wire cap is measured on the exact bytes
One session, one transaction
One native session performs the connect, TLS or the required STARTTLS upgrade, AUTH, MAIL, one RCPT per recipient, and a single DATA transaction for the recipients the relay accepted.
- certificate and hostname verified, always
- one RCPT per recipient
- one DATA per message
accepted, rejected or unknown
The final observable state becomes accepted, rejected or unknown, and the session closes. Only transient failures are retried; unknown never is, because the body may already have reached the relay.
- accepted means the relay took responsibility
- a 4xx reply halves concurrency
- unknown is not a retry signal
6 stages, one transaction. No worker process, no scheduler, and no persistence layer sits in between; queueing beyond one transport stays the caller's job.
At a glance
Section titled “At a glance”| Runtime | Version the project pins | Notes |
|---|---|---|
| Node.js | >=22.23.5 |
None |
| Bun | 1.4.4 |
None |
| Deno | 2.9.8 |
--allow-ffi --allow-read, plus --allow-net if your code opens sockets |
| Native targets | seven | linux-x64-gnu, linux-arm64-gnu, linux-x64-musl, linux-arm64-musl, macos-arm64, macos-x64, windows-x64 |
Anything outside those targets fails closed at createTransport with
CONFIG_NATIVE_UNAVAILABLE, naming the package you would need. The detail lives in
the quick start.
Start reading
Section titled “Start reading”- Quick start One send, and what each outcome means.
- Architecture Two crates, one binding, a runtime-neutral facade.
- Performance The relay benchmark, with its method and configuration.
- Errors, security, operations Stable codes, redaction, relay outages.
- The Sendust story Empty folder to 1.2.0, reversals included.
- License MIT or Apache-2.0, your choice.
Built in the open
Created and maintained by
Every page here is rendered from fandyajpo/sendust@v1.2.1, the source of truth. We just make it look good; fixes go there, not here.