Journal copy

A domain can have every message its users send or receive copied to a journal address, for compliance archiving. The copy is a short report with the original message attached.

The setting is per domain, at Admin > Domains > (domain) > Journal copy. A domain with no setting is not journaled.

Notice to users

Users cannot see or turn off journaling. Depending on local law (works council, employment, data protection and telecommunications rules) you may have to tell users, or get their agreement, before you turn it on. The admin page repeats this. Check it before you enable the setting.

Who can set it

Journal address Who can set it
A local account of the domain A global administrator or an administrator of that domain
A local account of another domain A global administrator
An external address A global administrator

A domain administrator may change or clear a setting only while it is off or names a local account of their own domain. An external setting, or one a global administrator pointed at an account of another domain, is shown read only and cannot be changed or cleared, so a delegated administrator can neither copy a domain’s mail off the server nor turn off or redirect a copy a global administrator set. When the local account of a setting has been deleted, the domain of the stored address decides, so a domain administrator can still repair a setting of their own domain. Every change is written to the log at info level as journal: setting changed, with the administrator, the domain, the old and new mode and the old and new address.

A local journal address must be a person account on a hosted domain: not a resource, a shared inbox or a group. The account may be disabled for login, which is usual for a dedicated journal account. The admin page refuses to delete an account that is some domain’s journal account.

Prefer a journal account in the domain itself. When a global administrator points domain D’s journal at an account of domain E, E’s domain administrators can reset that account’s password and read all of D’s mail.

An alias domain has no setting of its own: the setting of its target domain applies.

What is copied

Every message accepted for, or sent by, a user of the domain is copied once:

  • mail arriving from outside to the domain’s users (spam and mail that is held in quarantine later are included: the copy is made when the message is accepted, before any filtering);
  • mail the domain’s users send by SMTP submission or from the web interface, including calendar invitations and the public calendar link a user sends to an address they type;
  • mail collected from a user’s remote accounts.

A message sent and received inside one domain gives one report. A message between two journaled domains gives one report in each. A domain’s report lists every envelope recipient for mail its own users send (Bcc recipients included), and only its own users’ addresses for mail from outside, so one domain never learns another domain’s recipients.

Mail to or from the journal account itself is not copied, and a message addressed only to the journal address gives no report: its content is already in the archive. Which account sent a message is decided by the authenticated login, never by the envelope sender or the From header, which anyone can forge.

Not copied: copies made by forwarding rules and forwarding addresses (the original was already copied), vacation replies, delivery status notifications, address and forwarding verification mail, share invitations and reminders. These are generated by the server, not sent by a user.

The report

The report is a multipart message from postmaster@{domain} to the journal address with the subject Journal report: {original subject}. It has two parts:

  1. A text/plain part with these fields. The field names are fixed English and are not translated, so the report can be read by a program:

    Sender: alice@example.com
    Recipients:
      bob@example.com
      carol@elsewhere.example
    Groups:
      team@example.com
    Message-ID: <original-message-id>
    Direction: outbound
    

    Direction is inbound, outbound or internal. Groups lists the group addresses a sender wrote, when there were any; the members are in Recipients.

  2. The original message as message/rfc822, unchanged. A message that has a line over 998 bytes, a NUL or a bare CR is attached with the binary transfer encoding. A report for an external journal address cannot use that over SMTP, so it carries a base64 original.eml instead.

A local journal copy shares the original message’s stored file: the report stores only its own small text, and the original is not copied again. The journal account is not checked against rules, spam filtering or quota. Give the journal account no storage quota, or it fills up and the whole domain’s mail is deferred (see below).

An external report is sent with an empty return path, so a failure to deliver it never bounces into the domain. It is DKIM-signed as postmaster@{domain} and queued directly: it is not counted against any user’s send limits or a group’s fan-out cap, so one message to a large group gives one report however many copies it makes. Because the original is embedded unchanged as message/rfc822, a report of inbound mail carries content from outside that nobody authenticated (spam and phishing included) under the domain’s own signature. Configure the receiving archive to treat the attachment as untrusted.

When a copy cannot be written

Compliance needs completeness, so a message whose copy cannot be written is not accepted. The sender is told to try again later:

  • SMTP answers 451 4.3.0 with the same plain text as any other temporary local error. It does not say why.
  • Sending from the web interface fails with a message saying nothing was sent.
  • A collected remote message is left on the remote server and fetched again on the next run.

This happens when the local journal account no longer exists (logged at error level as journal: journal account missing), when the disk or the cluster cannot take the write, or when the outbound queue is unavailable. All of the domain’s mail is deferred while it lasts, and the admin page says so. Repair the account, or turn the journal copy off.

The copy is written before the message is queued, and the two writes are separate: they are not one atomic operation. If the copy was written and a later step fails, the sender’s retry writes a second report. A duplicate report is possible; a missing one is not. A web send retried with the same send ID writes each domain’s report once.

Limits

  • Journaling is done at acceptance, not in the delivery stage, because the delivery stage sees one recipient at a time and cannot answer the sender with a temporary error after the message was accepted.
  • A node on the agent role, which accepts no mail, does not journal.
  • On a cluster, upgrade every node before you turn journaling on. A node on an older version ignores the setting and does not journal, so mail it accepts is not copied.

View this page's source on GitHub