Skip to main content

Mail

Applies to: SimpleTwo 0.9.x, mail 0.72 · Checked: 08.10.2026

SimpleTwo mail is two roles. mail holds the mailboxes, the queue and the database; clients connect to it. mx is the edge: it takes mail from the internet, sends mail out, signs it with DKIM and checks what arrives. The mx nodes keep no database and no mailboxes, only a queue on their own disk. Between the two are LMTP (on mail) and port 2525 (on mx), closed to anyone but each other.

Before the MX record

Until DNS has an MX record pointing at an mx node, no mail reaches you from the internet — and that is right until somebody is named to answer abuse reports (the abuse@ and postmaster@ addresses). Make them aliases in identity for real people before you publish the MX record.

0. Deployment​

What you need first​

WhatWhy
the postgres role or an external clusterthe mail cluster's own database; the coordinator creates it
object storage — the s3 role or Settings → External storesmessage bodies and attachments, the simpletwo-mail bucket. Without storage the mail role does not start: the agent refuses to deploy it
the identity rolepeople, their addresses, aliases and groups, app passwords
a public name for mailclients reach mail over JMAP on 443 of this name
a public name, a public address of its own and a PTR for each mxthe MX target, the EHLO name and the certificate's name

The mail host is 2 vCPU / 8 GB; the disk is needed in storage rather than on the host: about 1.9 GB per person a year before attachment deduplication. More in sizing.

Order​

  1. Storage, postgres and identity are already up.
  2. Servers & deploys → Add a host, role mail: Private address (the leg toward postgres, storage and mx) and Public DNS name, e.g. mail.s2.<domain>. The name must point at the host's public address or at the organisation's address whose NAT forwards 443 here. The service obtains its own certificate on 443.
  3. The mx role — two hosts in different failure domains, each with a Private address and a Public DNS name, e.g. mx1.s2.<domain> and mx2.s2.<domain>. With a name and a certificate mx offers STARTTLS on 25 and opens app-password submission on 587 and 465; without a name only 25 works, without TLS, and the Mail DNS card warns no_mx_name.
  4. Publish the DNS records (section 1), the service addresses before the MX record.

When clients see mail​

The Mail tab appears in clients on the mail_url field of the discovery document (/.well-known/simpletwo.json). Once a minute the coordinator opens https://<mail public name>/healthz and announces mail_url (with mail_domains) only when it is the mail service that answers. Once it stops answering, mail_url is withdrawn after 15 minutes and the tab hides. Mail can also be switched off for the whole installation: Settings → Product options, the mail row (with the access mode beside it — direct, or VPN only).

curl -fsS https://mail.s2.<domain>/healthz
curl -fsS https://s2.<domain>/.well-known/simpletwo.json # look for mail_url

How people use mail — mail for the user. Clients reach it with the same sign-in as chat; third-party programs need an app password: sending is SMTP on 587/465 of the mx nodes, reading is JMAP only. There is no IMAP or POP3.

1. Domains, DNS records and DKIM keys​

Domains belong to organisations and are kept in the directory: Console → Settings → Organizations and domains — a block per organisation with its domains, the products switched on per domain.

  • Mail: whether mail accepts mail for the domain, and how: mailboxes (the domain's addresses are mailboxes, aliases and groups; a person's primary address may only be in such a domain of their organisation), aliases only (the domain receives for aliases of mailboxes in another), and for the time of a move relays to the old server (section 18). Each organisation has one primary domain: its mail's postmaster@ is there, and a person made without an address gets login@primary domain.
  • Sign-in: whether people may sign in with an address in the domain, and who checks the password (the directory or an identity provider).

A domain that still holds addresses cannot be removed, and mail cannot be switched off on one primary addresses are in; the primary is changed only by naming another. Mail takes the list from the directory itself (within half a minute) and keeps a copy for when the directory is away. The Holds column says how many mailboxes, aliases and groups a domain has.

Console → Mail → Mail DNS shows each mail domain's records — MX, SPF, DMARC, DKIM, SRV, MTA-STS and TLS-RPT — and checks each one in DNS.

RecordNameThe value the card expects
MX<domain>10 <mx name>. — one record per mx node, equal priority
TXT (SPF)<domain>v=spf1 mx -all
TXT (DMARC)_dmarc.<domain>v=DMARC1; p=quarantine; rua=mailto:dmarc@<domain>
TXT (DKIM)<selector>._domainkey.<domain>the public key; selectors look like s2e<date> (ed25519) and s2r<date> (RSA), both records are needed
SRV_submission._tcp.<domain>, _submissions._tcp.<domain>0 1 587 <mx name>. and 0 1 465 <mx name>.
SRV_jmap._tcp.<domain>0 1 443 <mail name>.
TXT, CNAME, TXT_mta-sts.<domain>, mta-sts.<domain>, _smtp._tls.<domain>see section 7

The PTR of each mx public address is set by whoever owns the address (the provider): it must point at the node's name. Without a PTR large mail services refuse your mail or file it as spam.

The coordinator makes the DKIM keys: an ed25519 and an RSA 2048 pair per domain. Changing a key takes three steps:

  1. New DKIM key makes a new pair; publish its two records.
  2. Activate the new key is available only once the new records answer in DNS.
  3. The old pair is retired; its records may go seven days later, on the date the card shows.

Two mx nodes​

There are two mx nodes by design, in different failure domains: on different hosts and, where possible, in different racks or sites. Each has its own public address, a PTR record and its own MX record, both with the same preference: senders spread mail between the nodes and, when one fails, go to the other. SPF mx covers both. rspamd's greylisting needs a Redis the two share. While there is one node, the Mail DNS card warns: when it is lost, mail from the internet waits at the senders and outgoing mail waits in the queue. Every thirty seconds the mail cluster checks that the nodes answer and shows it in /healthz (mx.mx_reachable), with a warning when none does.

From mail 0.73 a connection is not closed after its message: the next message to the same place goes on it — from the mail cluster to an mx node, from mx to the recipient's server or the relay, and from mx back into the cluster. A connection waits 30 seconds for the next message, carries at most 20 and serves at most 5 minutes; at most 4 wait for one server, and 32 in all. A message that needs stronger protection (an enforce MTA-STS policy at the recipient) never goes on a connection opened without it. The counters are in the mail cluster's and the mx node's /healthz (sessions): connections opened, messages sent on one already open, and why connections were closed.

Service addresses​

Every mail domain must take mail at postmaster@ (RFC 5321 requires it), abuse@ (complaints about mail from you), and dmarc@ and tls-reports@, where the domain's DNS records ask others to send their reports. Console → Mail → Service addresses shows whether they exist and makes the missing ones with a button: identity groups that cannot be deleted by accident and that anyone may write to. The administrator who pressed it is the first member; add the people who will answer in Users → Groups. An address a mailbox or an alias already holds is left as it is.

2. Mail connectors: devices without a password and the provider's relay​

Mail that passes mx another way than usual is set up with connectors in Console → Mail → Mail connectors. A connector is an object of the directory with a name of its own, as Exchange's Send and Receive Connectors are; each has the mx nodes it works on ticked. A new connector is on every node until unticked. A node takes a change within a minute.

A receive connector is for printers, an ERP or a monitoring system that cannot sign in: the networks they connect to mx port 25 from, the addresses they may write as (in the installation's mail domains), and where to (inside the organisation only, or anywhere). One network belongs to one connector. Everything else signs in with an app password on ports 587/465; why such a device cannot send is in the Message trace (section 9).

A send connector is the provider's relay, when the provider blocks outbound port 25: host:port (several, separated by commas, are tried in turn); mx hands it all outbound mail, DKIM-signed. When the relay asks for a sign-in, set a user name and a password: mx signs in with AUTH PLAIN, and only after STARTTLS with a certificate valid for the relay's name. The password is kept as the connector's secret in the directory and is not shown in the console again. With no send connector a node delivers to each recipient's MX directly; a node has one send connector at most.

3. Content filters​

The filters are set in Console → Mail → Edge protection: a row per filter, in the order they check — a name, the protocol (milter or ICAP), the address, what a filter that does not answer means, what a virus means, the anti-virus's find headers and a timeout. The filters are the organisation's own services: mx runs neither rspamd nor an anti-virus itself. Every mx node takes the list on its next poll and restarts with it. The console holds the list to the same rules mx does and saves nothing mx would refuse.

On an mx node installed without the agent the same list is the MX_FILTERS variable, or the file MX_FILTERS_FILE names (which is how the agent hands it over: a systemd environment does not carry regular expressions with a \ intact) — a JSON list in the order they check:

[
{"name": "rspamd", "transport": "milter", "address": "inet:127.0.0.1:11332", "on_error": "open"},
{"name": "av", "transport": "icap", "address": "icap://av.corp.example:1344/respmod", "on_error": "closed"}
]
  • milter — rspamd, clamav-milter, spamass-milter. A message the filter marks as spam (X-Spam: Yes and the like, the spam_signal field) goes to Junk; the filter's fields are in the message's delivery headers, and the message's bytes are never changed.
  • icap — an anti-virus over RFC 3507. How the product says it found something is the verdict field (headers, header_patterns, on_modified_body, status_codes).
  • on_error — what a filter that does not answer means: open lets the message through without it (the anti-spam default), closed tells the sender 451 to try again later (for an anti-virus).
  • on_virus — an anti-virus's find: quarantine (ICAP's default) or reject.

A list that does not parse stops the service: a filter configured and quietly not run is mail nobody checked. Greylisting is rspamd's greylist module with a Redis shared by every mx node; mx keeps no greylist of its own.

4. DNS block lists​

Every client of port 25 is checked against the block lists (default zen.spamhaus.org). A listed client is told 554 5.7.1 … blocked using <zone> at every MAIL. Addresses in the allow lists are not checked. The lists are set in Edge protection — zones separated by commas, zone=127.0.0.2|127.0.0.4 to count only those answers, off for none — beside port 25's connection bounds (total and per address, 0 for none). Without the agent: MX_DNSBL_ZONES, MX_DNSWL_ZONES, MX_MAX_CONNECTIONS, MX_MAX_CONNECTIONS_PER_IP.

From mail 0.76 the same card has the submission ports' own connection bounds, 587 and 465: total and per address, the two ports counted together and apart from port 25. There are none by default: empty or 0 is no bound, and the submission ports take any number of connections. A bound per address counts everyone behind one NAT as one client (and an IPv6 network by its /64): when an office's scanners and programs send through one public address, they all share it, so set it no lower than how many of them send at once. An mx node that sees IPv4 clients through a NAT64/SIIT gateway (addresses 64:ff9b::…) puts them all in one /64, sharing one bound per address. The mail devices' networks are not counted. A connection over a bound is told 421 4.7.0 on 587 and closed on 465, and each such refusal is a row of the submission refusal log (step connect, section 9). How many connections are open now is on the mx node's /healthz (submission_connections) — a good guide to the number. Without the agent: MX_SUBMISSION_MAX_CONNECTIONS, MX_SUBMISSION_MAX_CONNECTIONS_PER_IP.

Trusted ARC sealers​

The provider's relay for outbound mail is a send connector (section 2).

Trusted ARC sealers: mx verifies every incoming message's ARC chain and writes the result (arc=) into Authentication-Results. A chain decides anything only when its sealer is trusted (a domain, with its subdomains — a mailing service you know, say): a message whose DMARC failed is delivered when its chain passes and that sealer found DMARC passing. The list is empty by default, and then chains are only recorded.

Each zone tests itself at start and hourly. A zone that stops answering as it should is disabled, and the mx node's /healthz says why. The usual cause is a query through a public resolver, which Spamhaus refuses: the node's resolver must be its own. Commercial use of Spamhaus needs a DQS key.

5. The quarantine​

A message in which the anti-virus found a virus, and one a filter quarantined, is held on the server. The sender is told it was accepted. Each recipient gets a notice from the postmaster: who sent it, the subject, the date, the reason, and the number to give the administrator.

Console → Mail → Quarantine lists the held messages. Only an administrator releases one to its recipients or deletes it, and each action goes into the audit log with the administrator's name. What nobody decides on is deleted after 30 days (MAIL_QUARANTINE_DAYS).

6. Groups with members outside​

When a group has outside addresses (partners), each gets a copy of its own. The copy's reverse-path is the group's service address, sales+bounce.<token>@corp.example, so an outside recipient's refusal comes back to the group, not to whoever wrote to it.

  • A bounce is logged on the copy's path in the delivery log and kept in the mailbox named for the group's bounces. With none named, or while that mailbox is archived or belongs to a person who has left (until it is made shared), it goes to postmaster@ the group's domain: its mailbox or, when postmaster@ is a group (as the Service addresses card makes it), the group's members. Bounces never go to members outside.
  • The mailbox is named in Console → Mail → Group members outside → Bounces go to: any address of a person's mailbox, a shared one or a room's, not a group's, an archived mailbox's or the mailbox of a person who has left. An empty field gives the bounces back to postmaster@. The change is in the audit log. From mail 0.72.
  • Never passed outside: delivery notices, messages judged spam, held messages, and all of a group's mail when the installation has no mx node.
  • After five bounces in a row (each within a week of the last) a member outside is disabled: its copies stop and the log says why. An administrator can enable it again. From mail 0.72 whoever gets the group's bounces also gets a letter when a member is disabled: which group, which member, how many bounces in a row and how to enable it again — one letter per disabling.
  • When a sender signs with SPF alone and its domain has p=reject, a recipient outside may refuse the copy. That is a known limit of mailing lists.

7. MTA-STS​

When a recipient's domain publishes an MTA-STS policy in enforce mode, mx sends it mail only to the servers the policy lists, only over TLS, and only to a certificate valid for the server's name. When that cannot be done, the message is not sent in the clear: it waits and is tried again. The policies are kept on the mx node's disk; /healthz counts them.

Your own domain's policy is published by the coordinator. Mail DNS has three records for it:

  • _mta-sts.<domain>: a TXT record with the current policy's id. The id changes with the policy, and the record must then be updated.
  • mta-sts.<domain>: a CNAME to the coordinator. The coordinator obtains the certificate for this name itself and serves the policy at https://mta-sts.<domain>/.well-known/mta-sts.txt. The policy lists every mx node.
  • _smtp._tls.<domain>: a TXT record for TLS-RPT reports, sent to tls-reports@<domain>. Make that address an alias for whoever reads the reports.

The policy's mode is chosen on the same card. Start with testing: senders report failures but still deliver. Turn on enforce once a week of reports shows none. Under enforce a sender keeps the policy for a week and sends only to the nodes it lists. It takes a new mx node once it sees a new id in _mta-sts, so update that record as soon as you add a node.

The TLS-RPT reports you send​

From mail 0.70 you send TLS-RPT reports (RFC 8460) too — to the domains that ask for them with their _smtp._tls record. The mx node counts every connection to a receiver's mail server: whether it negotiated TLS and, if not, why (no STARTTLS, a certificate expired, untrusted or for another name, a server the receiver's MTA-STS policy does not list, a policy that could not be fetched). Once a day, two hours after midnight UTC, the mail cluster sends each such domain the past day's summary, from tls-reports@<first mail domain> and signed with your DKIM. The report itself is delivered even when the receiver's TLS is broken, as RFC 8460 requires.

  • Reports go only to mailto: addresses, two per domain at most. An https: address gets none: the mail cluster reaches the internet only through the mx node's SMTP; the list of reports says so.
  • Connections through the relay for outbound mail and to the old server during coexistence are not counted: they are not the receiver's mail servers.
  • A connection that carried several messages in a row (from mail 0.73) is counted once.
  • MAIL_TLSRPT_REPORTS=off turns the sending off; MAIL_TLSRPT_ORG is the organisation's name in the reports (by default as in the DMARC reports).
  • The list of thirty days is Console → Mail → TLS reports sent; the counters are in the mail cluster's /healthz (tlsrpt_reports) and the mx node's (tlsrpt).
  • Upgrade the mail cluster first, then the mx nodes: an older cluster loses the sums a newer node sends it.

8. DMARC reports​

The domains whose DMARC record asks for aggregate reports (rua) get them from you once a day: how many messages in their name arrived, from which addresses, whether they passed SPF and DKIM, and what was done with them. A UTC day's report goes out two hours after it ends, one per domain. It is sent from dmarc@<the first mail domain>, the address your own DMARC record gives for the others' reports; make it an alias for whoever reads them.

  • Reports go only to mailto: addresses, to two per domain at most. An address in another domain gets one only when that domain allows it with a _report._dmarc record (RFC 7489 §7.1). A report larger than an address's limit (!10m) is not sent to it.
  • SimpleTwo sends no failure reports (ruf): they would carry the messages' content.
  • MAIL_DMARC_REPORTS=off turns the reports off; MAIL_DMARC_ORG is the organisation's name in them (the first mail domain by default). Without an mx node no report is sent.
  • How many reports went and how many did not is in the mail cluster's /healthz (dmarc_reports). The list of thirty days, with the addresses and why a report did not go, is Console → Mail → DMARC reports sent.
  • A message that failed DMARC but was delivered on a trusted sealer's ARC chain (see "The relay for outbound mail, and trusted ARC sealers") is in the report with the reason local_policy, and its comment names the chain: who sealed each instance and the address the message reached each from (RFC 8617 §7.2.2). From mail 0.70.

9. The delivery log​

Console → Mail → Message trace. The path of any message — from the mx that took it to a mailbox or a remote server — is found by either side's queue id or by an address, over a period if you wish. The mx's events wait on the node's disk and reach the log even when the mail cluster was away. Who wrote to whom is personal data, so the card needs a role with audit:read.

From mail 0.74 the same card lists under the path what the submission ports 587 and 465 refused — the answer to "why can't the printer (or the program) send". The search is the same: an address is the login or the sender's address, an IP address or a network (203.0.113.0/24) the client's. Every refusal is written: without TLS (AUTH before STARTTLS, a handshake that failed — a device that speaks only TLS 1.0, say), too many connections (when a bound is set, from mail 0.76), at sign-in (an unknown login, a wrong app password, a locked account, too many wrong passwords from the address), at the sender, the recipients and the message (an address the login may not send as, a recipient that does not exist, the size, the messages a minute), and a session that ended after a refusal without a message. A row says when, how many times, the port, the client's address, the login, the step, the server's reply and why; there are no passwords and no messages in it, and an app password typed in place of the login is not kept either. Identical refusals are not written one by one: the first shows at once, the repeats of ten minutes as one row with their count, and a scanner trying logins or addresses folds into a few rows. A wrong password and a locked account are in identity's sign-in records too, with the client's address, which the person sees as well. Kept as the delivery log is, 30 days. On mx /healthz → submission_refusals says how many refusals were written and how many folded.

10. Mailboxes​

Console → Mail → Mailboxes finds mailboxes by address or name, by kind (people's, shared, rooms and resources), and those under legal hold or left by people who have gone. From mail 0.78 also those whose responsible person has gone themselves: "has left: name somebody else" stands beside their name.

  • One list, one card. People's, shared and rooms' mailboxes are one kind of object; what differs is the owner: a person (who signs in to it, its addresses on their card) or the organisation (a responsible person, nobody signs in). "Open the card" on any mailbox shows its owner, its grants and its addresses, and turns it over: a leaver's mailbox — "Make it the organisation's" with a responsible person; a shared mailbox — "Give it to the person", to somebody who has no mailbox yet. A mailbox given to a person becomes their own, with its mail and grants, under their addresses; the shared addresses are let go of and the console names them (give them to the person as aliases in the directory if they should stay). A person who has a mailbox already is not given another — grant them access.
  • One address, one holder. Shared mailboxes' addresses are in the directory's index with the accounts' and the groups': a shared mailbox's address is given to no account or group, and the other way round — the refusal names the holder. Under the list the console shows the addresses the move found held by another.
  • A shared mailbox is made here: an address in one of the mail domains, a name and a responsible person. "Open the card" shows who may open it and what they may do (read, read and change, full access), and whether they may send as the mailbox or on its behalf. The last access to a shared mailbox cannot be removed: grant a successor first. From mail 0.79 a leaver's mailbox has the same button (section 14).
  • A shared mailbox's addresses are on its card too: the primary address and the aliases, one per line. Mail to any of them reaches the mailbox; letters go out from the primary. An address another mailbox or a group holds is not given — the console names the holder. An address taken off the list is free at once.
  • Deleting a shared mailbox is the "Delete the mailbox" button. The mailbox disappears from everyone it was open to at once, its addresses are free (a group or another mailbox may take them straight away), and its mail goes into the recovery window (section 9) and is erased when the window is over, unless the mailbox is under legal hold. Until then a deleted mailbox can be restored under a free address: the same people get it back with the same rights, and its mail returns where it was. A person's mailbox is not deleted this way — it goes with the person (section 14).
  • A legal hold goes on any mailbox, whoever it belongs to: while it stands, neither retention nor any cleanup destroys its mail. Lifting it asks for confirmation. A person's mailbox's hold is the person's: it is set on their card (section 14) and only shown here. A shared mailbox's and a room's hold are set here.

Changing mailboxes and access takes users:write; each change is written to the access audit.

11. Sending as a group​

Who may write to a group is its rule in identity. Console → Mail → Sending as a group is who may send as the group, from its address: "as the group" (the message is the group's alone) or "on behalf" (the person is named in Sender). Every such message is in the access audit.

12. The mailbox access audit​

Console → Mail → Mailbox access audit shows who opened which mailbox and what they did: access to shared mailboxes and through delegation, and always what changes a mailbox's access or where its mail goes (a recall, an import or export, sending as somebody, an app password, a release from quarantine). It holds no subject and no body. Filter by mailbox, by who acted and by dates; "Export for the SIEM" saves the selection as JSON lines. It needs audit:read. What is written is set by MAIL_AUDIT (off, shared — the default, all).

13. The disclaimer​

Console → Mail → Disclaimer sets, per mail domain, a text (and, optionally, HTML) added to every message sent from the domain, to every recipient, before the DKIM signature. The marker is how a reply that already carries it is recognised, so it is not added twice.

14. Leavers' mailboxes​

A person's mailbox outlives their account and is kept indefinitely by default. The retention policy sets how many days after the person has gone the mailbox is archived (accepts no mail, stays readable) or purged, and how many days before the responsible person is warned. A person's mailbox under legal hold is never purged; a shared one is the organisation's and is left alone.

The policy, the responsible person and the hold are the directory's​

The leavers' policy is one for the organisation and one for every service (mail, files and the rest), and the responsible person and the legal hold are set on the person, not the mailbox, once for every service. The directory holds them, and they are set in the console:

  • the policy — Console → Settings → Leavers;
  • the responsible person and the hold — the person's card under Console → Users. The hold applies whatever the person's state, someone still working included: while it stands, mail neither purges their mailbox nor erases what was deleted from it after the recovery window (section 15).

From mail 0.83 the directory is the only source of these values: mail has no retention policy of its own and no responsible person or hold of its own for a person's mailbox.

  • The Mail tab's "Leavers' mailboxes" card shows the directory's policy and opens Settings → Leavers; a person's mailbox card shows the person's responsible person and hold and opens their card. Neither can be changed on the Mail tab.
  • A shared mailbox's responsible person, and a shared mailbox's and a room's hold, stay the mailbox's own and are set on the Mail tab: a shared mailbox is not a person. A leaver's mailbox can be made shared, with its own responsible person; the person's hold goes with it to the shared mailbox.
  • The warning about a mailbox and the letter about a leaver's personal files go to the person's responsible person — even when the leaver had no mailbox.
  • When the directory cannot be reached or answers something unusable, mail destroys nothing: no purge of a leaver's mailbox, no erasing after the recovery window, no erase from the console; warnings and archiving wait for the next pass too. Mail asks the directory again right before purging each mailbox, so a hold set a minute ago still applies. A leaver's mailbox cannot be made shared meanwhile either: the person's hold cannot be read.
  • When the directory says a person is working while mail has them as gone, the mailbox waits until the two agree. The mailbox of an account the directory does not have waits too: no warning, no archive, no purge.
Upgrading to mail 0.83

Before mail 0.83, until the directory had copied mail's values over, mail worked with its own policy and holds, and kept on a mailbox a hold the person did not have in the directory ("hold differs"). From mail 0.83 none of that exists, and nothing is carried over: a policy, a responsible person or a hold set only in mail and never taken by the directory is lost. Check them in Settings → Leavers and on the people's cards before upgrading.

The mail cluster's /healthz shows it: retention.directory_read_at and retention.directory_error — when the directory was read and how the last attempt ended, retention.postponed — why the last pass stopped, retention.waiting — how many mailboxes wait and why (person_here, person_unknown, directory_unread and the earlier reasons); for the deleted-mail sweep, deletion.scrub_postponed.

From mail 0.78, deleting a person switches off at once everything that acted for them, whatever the provisioning mode and the retention policy say. The mailbox stays, receives mail and keeps its addresses, and:

  • nothing reaches the person's phones and browsers: their devices and push subscriptions are removed, a sign-in with their token or app password is refused, and an open connection is closed;
  • their Sieve rules are kept as written, but their forwarding, notices and auto-reply do not run — only the sorting into folders does; a message a rule would have forwarded stays in the Inbox;
  • the messages they scheduled to send later — from their own mailbox and from somebody else's — go back to Drafts in their own mailbox;
  • their rights on other mailboxes and to send as groups are removed (a step of the deletion's task); each removal is a row in the mailbox access audit naming what was removed, so that it can be given again;
  • nothing can be given to a person who has left (the console refuses), and a responsible person who has left is warned of nothing: the mailbox reaches its archive and waits until somebody else is named.

Who gets access to a leaver's mailbox is the administrator's choice when deleting them (from mail 0.86): in the deletion's plan, under the steps, "Who gets access to their data". The options:

  • read-only for those who already have access (the default when the directory names no responsible person for them): every access to the mailbox that gives more than read — to a person or to a group — is lowered to "may read" and "does not send", the way an administrator would;
  • give access to a person (the directory's responsible person is proposed): they get read, read and change, or full access; everybody else reads;
  • make the mailbox shared with a responsible person — the organisation takes it, and its access stays as it is;
  • change nobody's access.

The same choice applies to the home folder in Files. It shows as steps in Current tasks and in the console's audit; each change of a right is in the mailbox access audit with what it was. These are the mailbox's ordinary rights: what you set later on the "Who may open it" card is what applies, sending as the mailbox included. A deletion that came from the directory or LDAP is read-only. A message somebody the mailbox is open to scheduled to send from it goes or is canceled at its time by the access they hold then.

A leaver's addresses live with the mailbox: taken while it is kept, moved with it when it is made shared, and freed only when it is purged. A newcomer whom the directory gave such an address gets a mailbox without it — the mailbox's card says which address it waits for — and gets the address when the purge frees it. An address any other mailbox or group lets go of passes the same way.

If the same person comes back, the mailbox is theirs again — with its mail, its addresses and its rules, which act in full again. The mailbox's access stays as the deletion and the administrator left it (from mail 0.86 mail gives nothing back by itself): what a right was before the deletion is in the mailbox access audit. Rights on other mailboxes and to send as groups are given again too. The clients register the devices at sign-in, and the scheduled messages stay drafts. If their mailbox was made shared, it stays the organisation's: the login back gets no mailbox until the directory decides whether it is the same person, and the mailbox's access stays as it is, for the administrator to set.

15. Deletion and recovery​

A deleted message goes through three states.

  1. Trash and Junk. "Delete" in a client moves a message to Trash. A message that has been there alone (not in another mailbox as well) longer than the set term is deleted. 30 days for both Trash and Junk by default; 0 never empties them. The term counts from when the message was put there.
  2. The recovery window. What is deleted — from Trash, by the person, by a recall or by the leavers' purge — leaves every device and releases its quota, but is kept whole for another 14 days (by default; 0 is no window, 365 at most). Throughout, an administrator can bring it back.
  3. Erased. After the window the message is erased for good: its row, parts, body and search index. Its bytes in the database and in S3 go a day after nothing references them.

The terms are set in Console → Mail → Deletion and recovery. One mailbox's deleted mail is there too: enter the mailbox's address and press "Show deleted mail".

  • Restore selected puts a message back where it was. One deleted from Trash or Junk comes back to the Inbox, or Trash's term would delete it again. A restored message has a new id, and clients see it as new.
  • Erase selected now and Erase all of it now erase without waiting for the window; it cannot be undone.

Every look at the list, every restore and every erase is in the mailbox access audit under your name: a list of what somebody deleted is a look into their mailbox.

Legal hold

A mailbox under legal hold erases nothing. Its owner can still delete — and is not told of the hold by a refusal — and what they delete waits in the window for as long as the hold lasts. The erase buttons are refused for such a mailbox. A person's mailbox's hold is the person's, in the directory (section 14), for people still working too; when the directory cannot be reached nothing is erased after the window, and the erase buttons are refused.

No window

A window of 0 days means deleted mail is erased at the next hourly pass and cannot be brought back. The console asks again before saving.

The sweep's last pass — how many were emptied from Trash and Junk, erased, and how many bodies were removed — is shown under the terms and in the mail cluster's /healthz (deletion).

16. Send later, snoozed mail and categories​

From mail 0.65 the clients can send a message later, snooze a message until a chosen time, and mark messages with categories. There is nothing to configure: all of it runs on the mail cluster, by the standards, with no protocol extensions of our own.

  • Send later. A message can be held up to a year ahead. Until then it sits in the Scheduled folder and waits in the mail cluster's queue; mx signs it with DKIM when it leaves, so the signature does not age while it waits. Sending can be cancelled, and the message returns to Drafts. If by the chosen time the mailbox is archived or the sender may no longer write from that address, the message does not leave: it returns to Drafts and the cancellation is written to the access audit (submission.cancel).
  • Snoozed mail. A message goes to the Snoozed folder and at the chosen time comes back, unread, to the folder it was snoozed from. A new reply in the same conversation brings it back at once.
  • Categories work as in Outlook: a name and a colour. Each mailbox has its own list; in a shared mailbox it is the team's list. A category taken off the list stays on the messages, but the clients no longer show it.

The Scheduled and Snoozed folders appear in a mailbox the first time they are used and cannot be renamed or deleted. How many messages wait to be sent and how many are snoozed is shown in the mail cluster's /healthz (send_later, snooze).

17. Forwarding outside​

A person's rule can forward a copy of a message to another address. By default only to addresses inside the organisation: a rule that sends a mailbox's mail outside is the usual way mail leaks, and most organisations keep such forwarding off.

From mail 0.70 it can be turned on: Console → Mail → Forwarding outside → Allow forwarding outside. A rule's copy then goes to an address outside too:

  • The envelope is rewritten by SRS. The sender in the envelope becomes an address of your domain (SRS0=…@your-domain): the receiver sees the message came from your servers, and SPF passes. If it cannot be delivered, the bounce comes back to that address; the mx node checks its signature and age (21 days) and sends the bounce on to the original sender. Only notices go back — bounces and automatic replies, with the null sender, at most ten a day per address, without your DKIM signature. Anything else sent to such an address is refused as to an address that does not exist, and a session that tries such addresses at random is cut off.
  • The copy is sealed with ARC, so the receiver sees it came through you and what the message looked like when it reached you.
  • Not everything is forwarded. Only a message whose sender was vouched for on arrival leaves — SPF passed for its address, or a valid DKIM signature of its domain. Junk, messages that failed DMARC, and delivery notices themselves do not leave. So mail that reached you through another server is not forwarded either — for instance from the old mail server during coexistence: SPF there is checked against that server's address.
  • Your DKIM signature only for what is genuine. A forwarded copy is signed by your domain only when it was written at your organisation or passed DMARC on arrival; otherwise it leaves without your signature, sealed with ARC.

The same card lists every mailbox whose rules forward outside, and where to, whether forwarding is on or not: before turning it on you see whose mail it lets out. Turning it on or off is written to the access audit (forwarding.set). While it is off, such rules send nothing outside and their other actions still run. The counters are in the mail cluster's /healthz (forwarding).

From mail 0.70 a rule can also notify about a message (Sieve notify, RFC 5435): a short note — who wrote, about what and when, never the message's own text. Inside the organisation the notice always goes; outside only while forwarding outside is on. Junk and automatic messages notify nobody; the counters are in the sieve block of the same /healthz.

The key that signs SRS addresses is replaced by itself once a year; Rotate the SRS key in the same card does it at once. Normally the new key signs from five minutes on and bounces to addresses of the old one are taken for 22 more days. If the key may have leaked, answer OK to the second question: the old keys are revoked at once, and bounces to addresses they made are lost.

The mx nodes must run mail 0.70 before you turn forwarding on: they are what turns SRS bounces back.

18. Coexistence with the old server​

An organisation moving off Exchange or another server does not move its mailboxes in one day. Since mail 0.64 the domain's MX record can point at SimpleTwo early, and mailboxes switch one at a time: mail for those not yet moved goes on to the old server.

  1. Console → Settings → Domains: in the Mail column choose relays to the old server for the domain and give the old server as host or host:port (Exchange's receive connector; the port defaults to 25). The console says how many of the domain's mailboxes will have their mail sent to the old server and asks you to confirm. The primary domain may relay too — it usually is the one that does.
  2. At first every mailbox of the domain is at the old server: a mailbox exists here empty long before the move, and mail must not land in it early. An address nobody here knows also goes to the old server rather than being refused.
  3. Console → Mail → Mailboxes, column Mail goes to: Switch here on a mailbox that has been moved. From then on its mail is delivered here; Back to the old server undoes it. Every switch is written to the access log.
  4. When every mailbox is switched, set the domain back to holds mailboxes — relaying stops.

Worth knowing:

  • Mail sent from inside goes to the old server too: a message to a colleague whose mailbox is still there, a group's copy for such a member, a meeting invitation.
  • Mail to the old server goes to the address given only, with no MX lookup (the MX is you already) and never through the relay for outbound mail; TLS if the old server offers it, its certificate not verified (it is usually issued by an internal CA). It is DKIM-signed like all outbound mail.
  • A message the filters hold stays in quarantine here and, once released, takes the cluster's route.
  • A message that has already passed through your nodes many times is refused (554 5.4.6): that breaks the loop if the old server sends mail back.
  • Counters are in the mx node's /healthz (coexist: how many messages went to the old server, how many of them to unknown addresses, and the twenty most frequent unknown addresses) and in the mail cluster's (coexist.rerouted).