CUBELinux · CUBEmail

Integration report · 2026-11-18 · replacing mailboxes with a mail app · seven domains on one Postfix/Dovecot box

What this page is. CUBEmail is the mail layer of the CUBE estate: the free CUBED-mail desktop app (and CUBE Contact's mail reader) talking to an ordinary Postfix + Dovecot server. The protocol is mundane on purpose. What is unusual is what the server stores — and that decision came out of this integration, because a standard mailbox is a copy of your mail that the server can read.

What changed

For a while the mail box did the ordinary thing: one Postfix, one Dovecot, seven virtual domains, Maildir on the disk — /var/mail/vhosts/<domain>/<address>. A conventional mailbox is a plaintext copy of every message held by the party that is not the recipient. It survives in backups, it sits on a disk that can be seized or snapshotted, and any administrator can read it. Encrypted transport does not change any of that; TLS protects messages in flight, not at rest.

The integration replaced the mailbox's role in three ways:

  1. The volume under every mailbox is sealed. Mail lives on a LUKS2-encrypted XFS volume (label CUBEMAIL) that is opened by passphrase at boot and is not mounted otherwise. A stolen disk, a disk image, or a hypervisor snapshot contains no plaintext mail — not even the envelope. The passphrase is kept off the server on purpose.
  2. When a mailbox turns on the sealed relay, the body never lands readable at all. An LMTP proxy on 127.0.0.1:2525 intercepts each delivery and seals the body to the mailbox's registered X25519 key — ephemeral X25519 + HKDF-SHA256 (cube-sealed-relay-v1) + ChaCha20-Poly1305 — and hands Dovecot the sealed envelope. The mailbox stores ciphertext. The body becomes readable only inside the desktop app, which pulls the ciphertext over normal IMAP and decrypts it with the account's key.
  3. Reading moved to the app. CUBED-mail is a free Linux desktop application with its own sealed CUBE store; the 16-digit key that opens the window is also the key that seals the store on disk (iterated SHA-256 for 200,000 rounds wraps the Ed25519 identity with AES-GCM into pin.json, mode 0600; a wrong key exits 2 and opens nothing). CUBE Contact ships the same sealed-mail module. For mailboxes that do not opt into the sealed relay — the standard tier — nothing changes: standard IMAP and SMTP still work, Thunderbird still works, and the LUKS volume still holds the plaintext encrypted at rest.

There is also a mode where the mailbox is bypassed entirely: remote hold. With the sealed relay on, an account can have the relay hold its sealed envelopes instead of delivering them into the mailbox — 512 MiB per address, 8 GiB total, envelopes expire (1–30 days, default 7) and are always delivered into the mailbox first before being deleted. That is the difference between "mail at rest is encrypted" and "mail never rests anywhere readable at all".

The server half

piecewhat it is
MTA + IMAPPostfix and Dovecot on one Oracle Cloud instance; seven virtual domains — slopcup.com, soapp.io, cubelinux.com, powerbutton.io, dulrobotics.com, aiapq.com, coinstable.us.
sealed volumeLUKS2 + XFS, mounted at /var/spool/mail, holding all mail host state. Opened at boot with a passphrase that is deliberately not stored on the server.
sealing relaycubemail-relayd (LMTP on 127.0.0.1:2525) seals bodies to the recipient's registered public key; Dovecot stores the CUBE SEALED envelope.
relay registrycubemail-relay-registry (127.0.0.1:8765, published under /relay/*) registers a mailbox only after a real IMAP login against local Dovecot — external mailboxes cannot register. It also exposes /hold on|off|days, list and ack.
caps2 GB per domain (enforced by the relay, with Dovecot's 2 GB mailbox quota as a backstop) and 5 addresses per domain. Over the storage cap the message is rejected 552 5.2.2; at 5 addresses the order is refused and refunded.
provisioningStripe checkout → provision.php → spool → cubemail-provision-worker (a systemd path unit). It adds the domain, DKIM key and tables, a catch-all alias, the mailbox and credentials, approves the sender, and mails the buyer; own-domain orders work the same way.
transport hardeningDKIM signing per domain; MTA-STS in enforce mode on the estate domains; a TLS-RPT cron collecting reports. The DNS posture is part of the product, not an afterthought.

The app half

CUBED-mail is a fork of CUBE Contact cut down to mail only: the header is the settings gear, mail, search, theme, and a message count; /chat, /groups, /publish, /files, /relay and /call all redirect to /mail. It is free to use — no licence — and Linux-only today (GTK3 + WebKitGTK 4.1). The mailbox is not a place in the app's mind: the app is the place the mailbox becomes readable. Sync is ordinary IMAP; the difference is what the app finds there and what it does with it before writing to its own store.

Because the sealed-mail module is copy-identical between CUBE Contact and CUBED-mail, the two apps are the same reading path over the same server. The relay refuses to register anything that does not authenticate against the local Dovecot, so a sealed relay can only ever apply to a mailbox this server hosts — that line is what keeps "sealed" from becoming "encrypted to a mystery key".

The delivery path, before and after

stepbeforeafter (sealed mailbox)
deliveryPostfix → Dovecot LMTP → Maildir, plaintextPostfix → sealing relay → Dovecot LMTP → Maildir, ciphertext
at restplaintext on disk (encrypted by the volume alone)LUKS2 volume under a sealed body
readingany IMAP client, or rootthe app decrypts locally; server sees ciphertext
provider copyalwaysnone the provider can read

Why replacing mailboxes with CUBEmail was a good idea

What went wrong, and what it taught

The honest limits

How to try it

Standard mailboxes on any of the seven domains are sold at slopcup.com/mail — US$5 a month per domain, 2 GB total, up to five addresses, catch-all included. The sealed relay is included with the apps: turn it on in CUBED-mail or CUBE Contact, register the mailbox, and the next delivery lands as ciphertext. The apps are free downloads:

sealed mailboxciphertext at restIMAP-compatibleseven domainsautomated provisioninghonest limits