Skip to content

Security model

An adversarial review of the Go server was done on 2026-11-15 by an AI session that did not write the code. A second pass the same day fixed what was left open and reviewed calendars and contacts (JMAP, CalDAV, CardDAV, invitations by email, the iCalendar and vCard parsers) and the embedded database (Raft, snapshots, the control listener). The webmail clients were left out on purpose. No human has audited robinmail.

Severity Found Fixed Open
Critical 0 0 0
High 1 1 0
Medium 9 9 0
Low 10 4 6

Every finding of medium severity or higher is a public issue. The tracking issue is robinmail/robinmail#44.

Verdict: no finding is open that lets a stranger read mail, take over an account, change a calendar, or take the server down. Real mail is reasonable for a small group that accepts early software, with Rspamd on, the data directory on an encrypted disk, a default quota and backups, after a few weeks with throwaway accounts. The code has had AI reviews only, and it has not met real traffic.

  • Read another account’s mail, over JMAP, IMAP, downloads or the HTML view.
  • Read or change another account’s calendars and contacts, over JMAP or DAV, beyond what was shared.
  • Take over an account, or relay mail as a stranger.
  • Run script in the webmail through an HTML message.
  • Smuggle a message through SMTP line endings, or inject commands before STARTTLS.
  • Reach the database without a member’s certificate or the node’s own.

Also found sound: sessions and cookies, the cross-site request checks, account enumeration, the JWT and OIDC validation, the HTML sanitiser and its content security policy, the binding of every JMAP method and SQL statement to its account, alias loops and SRS, blob encryption and key wrapping, the node-to-node API and the Raft transport behind it, joining a cluster, backup and restore, secrets in logs. go vet is clean and govulncheck reports no vulnerabilities. The parsers of iCalendar, vCard, recurrence rules and the JSCalendar and JSContact conversions were fuzzed for ten minutes each without a failure.

Issue Severity What
#38 high Login rate limits could be outrun by many attempts at once.
#36 medium Limits per client address counted every IPv6 address on its own; now per /64.
#39 medium JMAP result references could grow a request past the size limit.
#37 medium A Sieve script could make one run cost minutes of CPU.
#40 medium A submitted message could carry more than one From field.
#42 medium The outbound queue and HTTPS fetches could be pointed at internal addresses.
#41 medium Anybody could lock an address out of its logins with wrong passwords.
#43 medium Inbound SMTP could drive the process out of memory.
#45 medium Invitation updates and cancellations by email were taken on the word of the From field.
#46 medium An old recurring event of every second cost a second of CPU per calendar query.
no issue low Turning TOTP on did not end mail sessions opened with the password.
no issue low A panic in one SMTP or IMAP session, or one delivery attempt, ended the whole process.
no issue low The HTTPS listener had no connection limit.
no issue low Failed logins from many client addresses could write to the database without bound.

All low:

  • OIDC links an existing account by its verified e-mail claim, and skips its TOTP unless the provider has require_totp.
  • The Docker image runs as root.
  • No default quota: set quota.default_bytes.
  • Automatic replies count against the account’s sending limit.
  • Every account sees every other account of the server as a principal, with its free/busy times, across all domains the server hosts.
  • Calendar and contact data are in the database as text, like the header fields.
  • Passwords: Argon2id, stored as a PHC string.
  • Web sessions: a cookie that is Secure, HttpOnly, SameSite=Strict and __Host-. An Origin check on every request to /auth and JMAP. JSON with its content type for everything that changes state.
  • Mail, calendar and contacts programs: app passwords. 160 random bits made by the server, stored as a hash, limited to imap, smtp, jmap or dav if wanted, revocable one by one.
  • Two steps: TOTP with recovery codes. The TOTP secret is sealed with the account’s key.
  • OIDC: optional, for the webmail only. Authorization code flow with PKCE.
  • Rate limits: failures are counted in a 15 minute window for all nodes together: per address for the web login, per address for mail programs that use the account password, per address for TOTP codes, and per client address (per /64 for IPv6) for all of them. Ten failures close an address for the rest of the window.
  • Known devices: a browser that completed a web login gets a cookie (__Host-robinmail-device, 180 days) signed with a key derived from the master key. Its wrong passwords count under the cookie and the client address instead of the address, so a stranger’s guesses do not lock the owner out of the webmail. The cookie is no credential: a stolen one gives ten guesses, like an address.
  • App passwords are limited per client address only: they cannot be guessed, so a stranger cannot close an address for mail programs that use them.
  • Writes of failures: each node writes at most a burst of 100, then 10 a second. Past that a failure counts in that node’s memory only and gets no auth event; the metric robinmail_auth_failure_writes_skipped_total counts them.
  • Audit log: auth events and what administrators did, read with robinmail audit, kept for auth.audit_retention_days.
  • Message files are encrypted per account under the master key.
  • The database is not, nor is its Raft log. It holds addresses, subjects, previews, the full-text index (from which a message can be put together again), and calendars and contacts as plain text.
  • The running server holds the master key. Encryption at rest does not protect against a compromised server.

The database is inside robinmail. It has no port.

  • Raft messages, snapshots and the member list travel on the node API, next to the message files. That API accepts only the certificates of the Raft members.
  • Commands reach the running server over a control listener on 127.0.0.1, which accepts only the node’s own certificate.
  • Whoever has neither has no way to the database. Whoever has a shell on a node with its data directory has every account.

The cluster test checks this: the node API refuses Raft, snapshots, the member list, blobs and ping to a client without a member’s certificate, and the control listener cannot be reached from another container.

Until phase 10 the database was rqlite, a separate service whose HTTP port had to be locked down. That section of these docs is gone with it.

Mutual TLS, with each side accepting exactly the certificates of the Raft members. Who may join is decided by robinmail node add on a member, which names the newcomer’s certificate.

No connection to an address that is not public, unless outbound.allow_private_addresses is set.

  • /dav takes Basic auth (an app password with the dav scope, or the account password while the account has no app password and no TOTP) or the webmail’s session cookie. The Origin check applies when the cookie is there.
  • A user reaches only their own calendar and address book homes. What others share with them shows up in those homes, with the rights the owner gave: read, or read and write.
  • A new invitation from outside is added to the calendar by itself when the mail’s From names the organizer and Rspamd did not take it for spam.
  • An update or cancellation of an event the account has, and a reply, are applied only when the From is verified: Rspamd found that DMARC passed for its domain, or the mail came from an account of this server. Otherwise they wait in the scheduling inbox and the email stays in the Inbox. Without Rspamd nothing from outside is verified. calendar.imip_unverified applies them anyway; the lab sets it.
  • Recurrence is expanded from near the range asked for, and stops at 250 000 instances for a rule with COUNT.
  • IMAP and submission need TLS before any login.
  • web.http_listen and metrics.listen must be on loopback.
  • SMTP and submission hold messages in memory within smtp.max_bytes_in_transit [100 MiB] together, smtp.max_bytes_in_transit_per_ip [25 MiB] per client address. Past it the sender is told 452 and tries again later.
  • The HTTPS listener takes web.max_connections [1000], web.max_connections_per_ip [100] per client address.
  • A panic ends one session, not the process.
  1. Put the data directory on an encrypted disk. It holds the database and the Raft log.
  2. Keep the master key file apart from the backups of the data.
  3. Let only the other nodes reach the node port (node.listen).
  4. Run Rspamd: it scans for spam and is what verifies invitation updates by email.
  5. Set a default quota.
  6. Check that the SMTP limits fit the machine’s memory: the defaults hold at most 100 MiB of messages in transit; delivery copies a message two or three times.
  7. Start with throwaway accounts.

Open an issue on GitHub. This is an experiment built in public. There is no private channel.