RustPost

The project

Contributing

The repositories, building and testing from source, signing off your commits, the provenance policy, and helping with translations.

On this page

RustPost welcomes contributions: code, tests, documentation, translations and bug reports.

The repositories

RepositoryWhat it holds
rustpost-serverThe Rust server: protocols, storage, the admin API, the Docker image and the deployment files.
rustpost-webThe webmail and the admin console (React, MUI, Vite, Lingui).
rustpost-siteThis website and its documentation (Next.js, MDX).

Some repositories may still be private while the project prepares its first public release.

Sign off your commits (DCO)

RustPost uses the Developer Certificate of Origin instead of a contributor license agreement. No company holds the rights to relicense your work, which is what makes the "no paid edition" promise credible. Add a Signed-off-by line to every commit:

git commit -s

Provenance policy

RustPost must be able to show where its code came from.

  • Do not copy, translate or port code from other mail servers' repositories, and do not read their source to work out how to implement something here. In particular, nothing from Stalwart's server repository or its tests, even though its license would allow it.
  • Running another server as a black box to compare behaviour is allowed.
  • Libraries published as separate crates under their own licenses (such as mail-parser and mail-auth) are allowed, behind our wrapper crates.
  • Copying from other AGPL-compatible projects is allowed with attribution: say what and from where in the commit message, and keep the original notices.
  • AI-assisted contributions follow the same rules: you are responsible for what you submit and must be able to explain it, your sign-off covers it, you never point a tool at a forbidden source, and you say in the pull request when a substantial part was generated.

A script and cargo deny enforce the dependency side of this in CI.

Building the server

You need:

  • Rust 1.99.1 (the repository's rust-toolchain.toml selects it; with rustup this is automatic).
  • PostgreSQL for the tests and to run the server.
  • Python 3 for the interoperability scripts (standard library only, plus openssl).
git clone https://github.com/Rust-Post/rustpost-server.git
cd rustpost-server
cargo build --release
cp deploy/rustpost.example.toml rustpost.toml   # then edit [store] url, paths and hostname
export PGPASSWORD='the-database-password'
./target/release/rustpost domain add example.org
RUSTPOST_PASSWORD='choose-one' ./target/release/rustpost user add ana@example.org
./target/release/rustpost serve

IMAP refuses passwords without TLS, so a local server needs a certificate in [tls] (a self-signed one is fine for testing).

Tests

The tests need a PostgreSQL database they may use. Each test creates a schema of its own and drops it when done, so they run in parallel and leave nothing behind. Without RUSTPOST_TEST_POSTGRES_URL, the tests that need the database fail with a message saying so; they never skip silently.

export RUSTPOST_TEST_POSTGRES_URL=postgres://user:password@localhost/rustpost_test
cargo test --workspace
cargo deny check

The interoperability scripts start the real binary and talk to it the way clients do:

ScriptWhat it checks
interop/e2e.pySMTP with TLS to IMAP, durability after kill -9, web login, the admin API, submission through the queue, SPF and DMARC with a fake DNS server, blocklists, calendar scheduling.
interop/caldav.py, interop/carddav.pyClient request sequences, sync, sharing, and two processes on one database.
interop/managesieve.pyThe ManageSieve command set and parity with the webmail's API.
interop/crypto.pyBoth WKD methods, key lookups, Autocrypt, and byte-exact pass-through of PGP and S/MIME mail.
interop/autoconfig.pyAutodiscover, Mozilla autoconfig and the Apple profile, each followed by real logins.
cargo build -p rustpost
python3 -I interop/e2e.py target/debug/rustpost --postgres "$RUSTPOST_TEST_POSTGRES_URL"

On Linux with only Docker, scripts/docker-test.sh starts PostgreSQL and a Rust container and runs the tests and the main interop scripts.

Rules for server changes

  • Every change to mail goes through rp-mail; protocol crates never call the store's mutating methods directly.
  • Third-party protocol libraries stay behind their wrapper crates.
  • Storage changes need a new PostgreSQL migration and a check in the conformance suite. Never edit a merged migration. Migrations are expand-then-contract, so old and new nodes can run side by side.

Building the webmail and console

You need Node.js 22.12 or later and npm.

git clone https://github.com/Rust-Post/rustpost-web.git
cd rustpost-web
npm ci
npm run dev:mock          # webmail with an in-browser mock server: demo@rustpost.test / demo
npm run dev:admin:mock    # admin console with a mock: admin@rustpost.test / admin
npm run lint && npm run typecheck && npm test

Without the mock, npm run dev proxies the API to a running server (RUSTPOST_DEV_SERVER, default https://localhost:8443). User-visible text must go through the translation catalogs; ESLint enforces it.

Translations

  • Webmail and console: Lingui catalogs in locales/ of the web repository, messages.po (webmail) and admin.po (console), for en (the source) and es. Run npm run i18n:check after changing text.
  • This website: UI strings in src/i18n/messages/<locale>.ts and documentation pages in content/docs/<locale>/<page>.mdx of the site repository. Keep the [#id] at the end of headings unchanged, so links work in every language.
  • Reviews and new languages are very welcome. The webmail's layout already supports right-to-left scripts, so those languages can be added too.

Reporting bugs

Open an issue in the repository concerned with what you did, what you expected and what happened, and the version or commit. For security problems, see Reporting a vulnerability.