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

CrateResponsibility
sentio-coreShared types, error model, configuration, repository traits
sentio-storePostgreSQL repositories and the Redis KV pool
sentio-smtp-serverInbound SMTP state machine, TLS, SASL AUTH
sentio-smtp-clientOutbound delivery, MX resolution, connection pooling
sentio-authDKIM, SPF, DMARC, ARC, MTA-STS, DANE, BIMI
sentio-queueNATS/JetStream producers and consumers
sentio-storageS3-compatible blob storage, ClamAV scanning
sentio-spamrspamd integration and the built-in scoring engine
sentio-abuseRate limiting, IP bans, greylisting, reputation
sentio-llmLLM classification, with a choice of provider
sentio-webhooksHMAC-signed event dispatch with retries
sentio-observeStructured logging, Prometheus metrics, OpenTelemetry
sentio-apiAxum 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.

TierCostWhat runs
ConnectionSub-millisecondIP bans, connection and AUTH rate limits, DNSBL lookups, greylisting, reputation scoring, reverse DNS
ContentTens of millisecondsrspamd or the built-in engine: Bayesian classification, fuzzy hashes, URL reputation, header heuristics
LLM tiebreakBorderline onlyRuns 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

AreaImplemented
Core SMTPRFC 5321 and 5322, plus the ESMTP extensions
Transport securitySTARTTLS, MTA-STS, DANE, TLS-RPT
AuthenticationSASL, DKIM, SPF, DMARC, ARC, BIMI
DeliverabilityOne-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 --workspace

An 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.sh

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