A backup MX is a second mail server that accepts and holds your domain’s mail when the primary server is unreachable, then forwards it on once the primary returns. On paper it sounds like a must-have for reliability; in practice modern sending servers already retry for days, so a backup MX adds the most value in narrow cases and can quietly become a spam liability if set up carelessly. This runbook covers configuring a secondary exchanger on cPanel, when it earns its keep, and the filtering tradeoffs to weigh before you enable one.
What’s happening
Mail routing follows MX priority: senders try the lowest-priority-number MX first, and only fall back to higher-numbered MX hosts if the first cannot be reached. A backup MX is simply an additional MX record with a higher priority number pointing at a second server configured to relay mail for your domain. When the primary is down, senders connect to the backup, which accepts the mail and queues it, retrying delivery to the primary until it comes back — at which point the backlog flushes through.
The catch is what a backup MX does to spam handling. Spammers deliberately target the backup MX, because secondary servers historically apply weaker filtering and recipient verification than the primary. If your backup MX accepts mail for any address @example.com without verifying the recipient exists, it becomes a relay for backscatter and a soft target. And because most legitimate senders already queue and retry for up to several days on their own, a brief primary outage usually resolves itself without a backup MX at all. So the real question before configuring one is whether your outage profile justifies it — and if so, that the secondary verifies recipients and filters as strictly as the primary.
How to verify
See the domain’s current MX records and priorities.
# Current MX set and priorities (lower number = tried first)
dig +short MX example.com
dig MX example.com +noall +answer
# Confirm the primary is this server
dig +short mail.example.com
curl -s https://api.ipify.org; echo
On the secondary server, confirm it is configured to relay for the domain (not treat it as local):
# The backup must list the domain as a relay/remote target, never local
grep -w example.com /etc/localdomains /etc/remotedomains
# On the secondary, the domain should be set to relay to the primary
exim -bt postmaster@example.com # should route toward the primary, not deliver locally
After a test, confirm the backup queues and then hands off:
# On the backup, watch it accept and queue while the primary is down
tail -f /var/log/exim_mainlog | grep 'example.com'
exim -bp | grep 'example.com' # queued for the primary
The fix
-
Decide whether you actually need a backup MX — the first and most important step. If your primary has good uptime and your senders are normal mail servers (which retry for days), a backup MX adds little and adds spam surface. It earns its keep mainly for domains with frequent short outages, links that drop often, or senders that do not retry. If none of that applies, skip it.
-
Add the secondary MX record with a higher priority number — in WHM » DNS Zone Manager (or your authoritative DNS), add a second MX for the domain pointing at the backup server with a higher number than the primary, e.g. primary
10 mail.example.com, backup20 backup.example.net. Senders use the backup only when the primary is unreachable. -
Configure the secondary to relay for the domain — on the backup server, set the domain as a backup/secondary mail exchanger so Exim accepts mail for it but relays to the primary rather than delivering locally. On a cPanel secondary this is the Backup Mail Exchanger routing option; confirm the domain lands in the relay configuration, not
/etc/localdomains. -
Make the backup verify recipients — the single most important anti-spam setting. Configure the secondary to do recipient verification against the primary (call-forward / recipient callout) so it rejects mail to addresses that do not exist, instead of accepting everything and generating backscatter. A backup that accepts any recipient is a spam magnet.
-
Apply the same RBLs and filtering on the backup — mirror the primary’s RBL and SpamAssassin configuration on the secondary so spammers gain nothing by targeting it. Weaker filtering on the backup is exactly what attackers look for.
-
Set a sane retry and queue policy on the backup — configure Exim retry rules on the secondary so queued mail is attempted to the primary frequently after it recovers and the backlog flushes promptly, but does not retry so aggressively it hammers a still-recovering primary.
-
Test by stopping the primary briefly — confirm the design works: stop Exim on the primary (or block port 25 inbound), send a test from outside, verify it queues on the backup, then restart the primary and confirm the mail flushes through and lands in the mailbox.
If you conclude a backup MX is not worth the spam tradeoff, that is a valid outcome — relying on senders’ own multi-day retry is often the simpler, safer choice. When you do run one, recipient verification and matching filtering are what keep it an asset rather than a liability. Stack Harbor designs cPanel mail-routing and redundancy under cPanel/WHM management — start a conversation.