Architecture
A Rust workspace of thirteen crates. PostgreSQL holds state, Redis backs the KV layer, NATS/JetStream carries the queues, and S3-compatible storage holds message bodies.
Crates
| Crate | Responsibility |
|---|---|
sentio-core | Shared types, error model, configuration, repository traits |
sentio-store | PostgreSQL repositories and the Redis KV pool |
sentio-smtp-server | Inbound SMTP state machine, TLS, SASL AUTH |
sentio-smtp-client | Outbound delivery, MX resolution, connection pooling |
sentio-auth | DKIM, SPF, DMARC, ARC, MTA-STS, DANE, BIMI |
sentio-queue | NATS/JetStream producers and consumers |
sentio-storage | S3-compatible blob storage, ClamAV scanning |
sentio-spam | rspamd integration and the built-in scoring engine |
sentio-abuse | Rate limiting, IP bans, greylisting, reputation |
sentio-llm | LLM classification, with a choice of provider |
sentio-webhooks | HMAC-signed event dispatch with retries |
sentio-observe | Structured logging, Prometheus metrics, OpenTelemetry |
sentio-api | Axum REST API with generated OpenAPI |
Anti-Spam In Three Tiers
The tiers are ordered by cost, so expensive checks only ever see traffic the cheap ones could not decide.
| Tier | Cost | What runs |
|---|---|---|
| Connection | Sub-millisecond | IP bans, connection and AUTH rate limits, DNSBL lookups, greylisting, reputation scoring, reverse DNS |
| Content | Tens of milliseconds | rspamd or the built-in engine: Bayesian classification, fuzzy hashes, URL reputation, header heuristics |
| LLM tiebreak | Borderline only | Runs only inside a configurable review band. Clear ham and clear spam never reach a model. |
The review band is the part worth understanding: the classifier skips any message scoring outside it, so the model is a tiebreaker for genuinely ambiguous mail rather than a filter every message pays for. Widen the band and you spend more; narrow it and you lean harder on the content tier.
Standards
| Area | Implemented |
|---|---|
| Core SMTP | RFC 5321 and 5322, plus the ESMTP extensions |
| Transport security | STARTTLS, MTA-STS, DANE, TLS-RPT |
| Authentication | SASL, DKIM, SPF, DMARC, ARC, BIMI |
| Deliverability | One-click unsubscribe, FBL/ARF, BATV, DNSBL and URIBL |
The repository carries line-by-line compliance audits for RFC 5321, RFC 3207 and RFC 4954, which are the right place to check a specific requirement rather than take a summary's word for it.
Testing Without Sending Real Mail
Unit tests need no infrastructure:
cargo test --workspaceAn end-to-end harness exercises both directions against a running stack:
docker compose -f docker-compose.yml -f docker-compose.test.yml up -d
scripts/e2e/run-e2e.shIt sends real mail into the SMTP listener and asserts it is stored and routed, then submits via the API and asserts the delivered message reaches the sink carrying a DKIM signature.
Nothing escapes: the overlay enables [delivery.relay], which bypasses MX resolution entirely, and the fixtures use the reserved .test TLD. Point your own integration tests at that stack and assert against the sink.
Contributing
Issues and pull requests are welcome. CONTRIBUTING.md has the development workflow, build commands and code conventions, and participation is under the project's Code of Conduct. Security issues should not go through public issues; see SECURITY.md.
Sentio is dual-licensed under MIT or Apache-2.0, at your option - you do not have to satisfy both. MIT is shorter and compatible with GPLv2; Apache-2.0 adds an explicit patent grant. Contributions are accepted under the same dual licence unless you say otherwise.