All help articles

A secondary MX (mxbackupd)

A secondary MX takes mail for your domains while the mail server cannot: during an upgrade, a network fault or a longer outage, senders' servers deliver to it instead of retrying elsewhere or giving up. mxbackupd is one, built to run on other hardware.

What it does

Setting it up

  1. On the mail server, make a relay token (32 random characters or more) and set its SHA-256 in CORPSUITE_RELAY_TOKEN_SHA256. The token is for the secondary only, apart from the platform's service token.
  2. Build mxbackupd (make mxbackupd) and run it on the other machine with:

    VariableMeaning
    MXBACKUP_HOSTNAMEIts host name, such as mx2.example.com (required)
    MXBACKUP_PRIMARY_URLThe mail server, https://mail.example.com (required)
    MXBACKUP_RELAY_TOKENThe relay token (required)
    MXBACKUP_SMTP_ADDRWhere to listen (:25)
    MXBACKUP_DIRIts queue and recipient list (/var/lib/mxbackupd)
    MXBACKUP_MAX_MESSAGE_BYTESThe largest message (50 MiB)
    MXBACKUP_HOLDHow long mail waits before it is bounced (120h)
    MXBACKUP_TLS_CERT, MXBACKUP_TLS_KEYA certificate for STARTTLS (optional)
  3. Publish it as a lower-priority MX for each domain, after the mail server: example.com. MX 20 mx2.example.com. (the mail server being MX 10). Add its address to your SPF record only if it also sends (it does not: bounces go out through the mail server).

mxbackupd version prints its version. Its log names each list refresh that failed and each hand-over that did not go through; the queue is the *.json and *.eml files in its directory.