Backup MX and Mail Queues
What a Backup MX Server Does
A backup MX is a secondary mail server that accepts email for a domain when the primary mail server cannot be reached. MX stands for mail exchanger. The MX records in DNS list the servers that should receive mail for a domain, each with a priority number.
Lower priority numbers are tried first. If the primary server does not answer, the sending server tries the backup. In practice a backup MX acts as a holding place: it accepts the message and keeps it until the primary server returns, or it passes the message on.
How Mail Queues and Retries Work
A mail queue is a list of messages that a server has accepted but not yet delivered. When a sending server cannot reach a recipient server, or receives a temporary error such as a 4xx code, it places the message in its queue and tries again at increasing intervals.
Retry schedules are set by each server's software. The standard guidance for SMTP is that a sender should keep trying for several days before returning a message as undeliverable, so an outage of a few hours is usually invisible to senders. If the outage lasts longer than the retry period, the message bounces and the sender receives a report, explained in hard bounce vs soft bounce. Greylisting causes a similar deferral on purpose, as described in what greylisting is.
A backup MX also has downsides. It may accept mail before the primary server checks whether a recipient exists, so it can take in spam the primary would have rejected. Many administrators configure backup servers to check recipients or to apply the same filters as the primary.
A Six-Hour Outage at a Small Company
A company's mail server is offline for six hours for maintenance. Messages from customers are queued and retried by the customers' own servers. When the primary server returns, the queued messages are delivered, and the customers never see an error. If the outage had lasted several days, some senders would have given up and returned the messages as bounces.
Frequently asked questions
How long does a sending server keep retrying an email?
Usually several days. Most mail servers retry on a growing schedule and give up after a set period. The exact period is configurable, so it differs between servers. If a message is still undelivered at the end, the sender receives a bounce.
Does a small domain need a backup MX?
Not always. Sending servers already queue mail when the destination is down, so a backup MX matters mainly for long outages or for keeping mail flowing during planned maintenance. Many small domains rely on the redundancy provided by their hosting company instead.