Set up a third-party backup MX and mail queue
Keep inbound mail queued, and give a few people a way to read and send, while Exchange Online is down. Two designs, their risks, and how to rehearse failover and fail back before you need it.
Note
What this buys you, honestly. Sending servers already queue and retry, but not for the same time. RFC 5321 says the give-up time “generally needs to be at least 4-5 days” (RFC 5321, 4.5.4.1). Senders that are themselves on Exchange Online give up after 24 hours, and the sender gets a bounce with NDR 550 4.4.7 (Microsoft Learn: NDR 550 4.4.7). So in a short Exchange Online outage most inbound mail is only delayed, even with no backup at all, but in a longer one some mail may bounce. A third-party path buys you three things: mail held in a queue you can see, a way for a few people to read and send during a long outage, and control over when the queue drains. It also adds a second internet-facing door to your mail, which needs the same care as the first. Vendor names on this page are examples whose documentation we read on 23 November 2026, not recommendations.
What Microsoft documents, and what it does not
- One MX is Microsoft’s default. Microsoft’s DNS reference says: “You can have multiple MX records; however, that can cause problems for mail delivery. Having a single MX record that directs email to one mail system removes many potential problems.” The Exchange Online MX should have a preference “lower than any other MX records” (External DNS records for Microsoft 365).
- A filtering gateway in front of Exchange Online is documented. Microsoft describes this design in full, with the MX pointing at the third-party service, a locked-down Partner connector, and Enhanced Filtering for Connectors (third-party cloud service with Exchange Online).
- A lower-priority backup MX next to Exchange Online is not a design Microsoft writes up. We found no Microsoft page that describes or supports it. Microsoft’s inbound DANE guide assumes “there’s no ‘fallback’ or secondary MX record” (How SMTP DANE works).
Choose a design
| Design | MX points to | Who queues while Exchange Online is down | Read and send during the outage | Main risk |
|---|---|---|---|---|
| A. Filtering gateway in front | The gateway only | The gateway | Only if the vendor has a continuity inbox or webmail | All inbound mail depends on the gateway. Wrong connector settings hurt filtering every day, not just in an outage |
| B. Lower-priority backup MX | Exchange Online first, backup second | The backup relay | No, queue only, unless the backup vendor also offers webmail | A second door that skips Microsoft’s edge filtering. Clashes with DNSSEC and DANE. Not a Microsoft design |
| C. No backup, prepared MX swap | Exchange Online only | Each sender’s own server | Only after you swap MX to a fallback mailbox provider | Slow (bounded by the MX TTL), visible to the world, and mail lands in a different system |
Our recommendation: if you want queueing and a way to work during a long outage, use design A, because it is the one Microsoft documents and the one where Exchange Online can be locked to accept mail only from the gateway. Use design B only if you cannot move the MX, you do not use DNSSEC or DANE on the domain, and you accept the spam path. Design C is covered in R3 Mail not flowing and needs no extra service.
Vendor examples, read on 23 November 2026, not endorsements:
- Mimecast (gateway with continuity). Its docs say that during a Continuity Event, inbound mail is “automatically queued for a maximum of four days”, after which it bounces unless you pause the delivery queue, in which case Mimecast keeps queueing (Managing Continuity Events). Its prerequisites include at least one administrator with a cloud password that is not behind single sign-on, users who can sign in without the normal directory, Cached Exchange Mode for Mimecast for Outlook, and an Entra app permission listed as “Use Exchange Web Services (EWS) with full access to all mailboxes” (Continuity prerequisites).
- Proofpoint Essentials (gateway with continuity). Its packages datasheet lists “Emergency Inbox” and “Email Spooling”, each at 30 days (datasheet PDF). Read the vendor’s admin guide for how the Emergency Inbox activates and how users sign in to it.
- Queue-only backup MX services. Prolateral’s FAQ, as one example, says its backupMX queues mail “for up to 7 days”, then bounces it, with a default limit of 1 GB or 100,000 messages (backupMX FAQ). A queue-only service gives users nothing to read during the outage.
- Cloudflare Email Routing is not a backup MX queue. Its docs describe forwarding mail for your domain to verified destination addresses or to a Worker, with Cloudflare’s own MX records added to your domain, and Cloudflare DNS required (Route emails). Soft bounces on forwarding are retried with exponential backoff (Email lifecycle), but we found no documented hold queue for a downed Exchange Online and no stated retention time.
- Dyn Email Backup MX (the old mailhop service) is gone: its help page now shows only a deprecation notice (Dyn help). If an old
mailhopMX is still in your DNS, remove it.
Before you start
- A written decision from the business owner: which design, which vendor, what it costs, and that mail may sit at a third party during an outage. Check the vendor’s data processing terms with whoever handles data protection.
- Admin rights in Exchange Online (to create connectors) and at your DNS provider.
- The tenant’s real Exchange Online MX host. Copy it from the Microsoft 365 admin center (Settings, Domains, your domain, DNS records). Do not guess the pattern: a domain with DNSSEC enabled in Exchange Online uses a host under
mx.microsoft, and Microsoft plans to provision new accepted domains there too (Exchange Team Blog). - The vendor’s sending and delivering IP addresses or TLS certificate name, from the vendor’s own documentation.
- A sign-in to the continuity service that does not depend on Microsoft Entra ID. If the continuity inbox signs people in with their Microsoft account, it may fail in the same outage. Mimecast documents a cloud password for exactly this reason (Continuity prerequisites).
- The EWS question answered. Microsoft started disabling Exchange Web Services in Exchange Online tenant by tenant from October 2026; admins can still re-enable it for allowed apps until the final shutdown on 1 April 2027 (EWS deprecation, Exchange Team blog: Exchange Online EWS, your time is almost up). If a continuity product syncs mailboxes or calendars over EWS, ask the vendor in writing what still works.
- A maintenance window and one outside mailbox (a free account at another provider) for the tests.
Steps, design A: filtering gateway in front
1. Record what you have now
Resolve-DnsName -Name <yourdomain> -Type MX
Source: Resolve-DnsName, Microsoft Learn
Write the current MX hosts, preferences and TTL in the change record. This is your fail-back value.
2. Point the gateway at Exchange Online
In the gateway’s admin console, set the delivery destination (smart host) for your domain to the Exchange Online MX host you copied from the admin center. Microsoft’s DANE guide notes that a third-party gateway can use the mx.microsoft value as its target smart host (How SMTP DANE works). Turn on the vendor’s alert for queued (spooled) mail, and send it to a phone, not only to a mailbox in your tenant.
3. Lower the MX TTL, then move the MX to the gateway
Lower the MX TTL a day ahead. Then, in the window, replace the MX records with the gateway’s records exactly as the vendor documents them. Remove the Exchange Online MX from public DNS: Microsoft’s design has the MX pointing at the third-party service, and leaving the Exchange Online MX in place is a way round the gateway (Microsoft Learn: third-party cloud service with Exchange Online).
4. Lock Exchange Online to accept internet mail only from the gateway
Microsoft’s step: create a Partner inbound connector and restrict it to the gateway’s certificate (preferred) or IP addresses. Mail that reaches Exchange Online by any other route is then rejected.
Connect-ExchangeOnline -UserPrincipalName <admin@yourdomain>
New-InboundConnector -Name "Reject mail not routed through gateway" -ConnectorType Partner -SenderDomains * -RestrictDomainsToCertificate $true -TlsSenderCertificateName <gateway-certificate-name> -RequireTls $true
Source: third-party cloud service with Exchange Online, step 4, Microsoft Learn and New-InboundConnector, Microsoft Learn
If the vendor only publishes IP ranges, Microsoft’s alternative uses -RestrictDomainsToIPAddresses $true -SenderIpAddresses <gateway-ranges> instead of the certificate parameters.
5. Turn on Enhanced Filtering for Connectors on that connector
Set-InboundConnector -Identity "Reject mail not routed through gateway" -EFSkipLastIP $true
Source: Enhanced Filtering for Connectors, Microsoft Learn and Set-InboundConnector, Microsoft Learn
Microsoft “highly recommends” this over a mail flow rule that bypasses spam filtering, because gateway IP addresses are shared by many customers. If the gateway has more than one hop in front of Exchange Online, list every hop with -EFSkipIPs instead of -EFSkipLastIP $true.
6. If the gateway changes messages, trust its ARC seal
Get-ArcConfig
Set-ArcConfig -Identity Default -ArcTrustedSealers "<gateway-arc-domain>"
Source: Configure trusted ARC sealers, Microsoft Learn
Set-ArcConfig replaces the list. Include any sealers that Get-ArcConfig already showed. Get the sealing domain from the vendor.
7. Prepare the outbound path for the continuity inbox
If people will send from the vendor’s continuity inbox during an outage, that mail leaves from the vendor, not from Exchange Online. Before any outage:
- Add the vendor’s SPF include to your SPF record. Microsoft says you only need the third-party service in SPF if you send outbound through it (third-party cloud service), which is exactly this case.
- Set up DKIM signing at the vendor with your own domain (
d=your domain), so DMARC passes on DKIM alignment even if a forwarder breaks SPF. DMARC passes when either SPF or DKIM is aligned with the From domain (RFC 7489, 3.1). - Count SPF lookups. SPF allows at most 10 DNS lookups, and more is a permanent error (RFC 7208, 4.6.4).
Example record, with a made-up vendor include. Use the value your vendor documents:
example.com. TXT "v=spf1 include:spf.protection.outlook.com include:spf.gateway-vendor.example -all"
Source: third-party cloud service with Exchange Online (SPF), Microsoft Learn and RFC 7208
Steps, design B: lower-priority backup MX
Only if you accept the risks in the Traps section. The example uses a Postfix relay you run yourself. A hosted backup MX service follows the same logic in its own console.
1. Publish the backup with a higher preference number
Senders try lower numbers first (RFC 5321, 5.1). Never give the backup the same number as Exchange Online, or senders spread mail across both all the time. Example, with made-up host names:
example.com. 300 IN MX 0 example-com.mail.protection.outlook.com.
example.com. 300 IN MX 20 mx2.example.net.
Source: RFC 5321, 5.1 and External DNS records for Microsoft 365
The first line is an example of the pattern. Use the host the admin center shows for your domain.
2. Make the relay a real backup, not an open door
The relay must accept mail only for your domain, only for addresses that exist, and must deliver only to Exchange Online. Postfix documents this layout for a backup MX; the transport line is the “primary MX for a remote site” part, which makes the relay deliver straight to your Exchange Online host without an MX lookup:
# /etc/postfix/main.cf (example values)
relay_domains = example.com
smtpd_relay_restrictions = permit_mynetworks reject_unauth_destination
relay_recipient_maps = lmdb:/etc/postfix/relay_recipients
transport_maps = lmdb:/etc/postfix/transport
# /etc/postfix/transport (example)
example.com relay:[example-com.mail.protection.outlook.com]
Source: Configuring Postfix as primary or backup MX host, Postfix
Keep relay_recipients in step with your real addresses, including aliases and shared mailboxes. Postfix says this list “prevents your mail queue from filling up with undeliverable MAILER-DAEMON messages”. Run spam and malware filtering on the relay as well, because mail that comes in this way reaches Exchange Online from your relay, not from the internet.
3. Check how long the relay will hold mail
postconf maximal_queue_lifetime bounce_queue_lifetime
Source: maximal_queue_lifetime, postconf(5), Postfix
The Postfix default is 5 days. Size the spool disk for several days of your inbound mail and alert on queue size.
4. Pre-stage the Exchange Online connector, disabled
New-InboundConnector -Name "Backup MX relay" -ConnectorType Partner -SenderDomains * -SenderIPAddresses <relay-public-ip> -RequireTls $true -Enabled $false
Set-InboundConnector -Identity "Backup MX relay" -EFSkipLastIP $true
Source: New-InboundConnector, Set-InboundConnector and Enhanced Filtering for Connectors, Microsoft Learn
Do not add -RestrictDomainsToIPAddresses $true in this design. Normal internet mail still arrives at Exchange Online directly, and that setting would reject it. That is also why design B cannot lock the tenant the way design A does.
Rehearse it in a maintenance window
Do this before you rely on it, then once or twice a year. Write the date and what happened in the record table below.
Design A. Use the vendor’s documented way to make the downstream server unavailable or to start a continuity event (Mimecast documents scheduled Continuity Events). Then: send a message from the outside mailbox; confirm it shows as queued at the gateway and in its continuity inbox; reply from the continuity inbox to the outside mailbox and read the headers there for SPF, DKIM and DMARC pass; end the event; confirm the queue drains and the message appears in Exchange Online.
Design B. First check the relay refuses what it should, without sending any mail:
swaks --to doesnotexist@example.com --server mx2.example.net --quit-after RCPT
swaks --to someone@example.org --server mx2.example.net --quit-after RCPT
Source: swaks reference
Both should be refused at RCPT (an unknown user, and a domain you do not serve). If either is accepted, stop and fix the relay before anything else. Then make the relay hold mail as if Exchange Online were down, by deferring its delivery transport:
postconf -e "defer_transports = relay"
postfix reload
Source: defer_transports, postconf(5) and postconf(1), Postfix
Send one test message straight to the relay with swaks --to <real-user@example.com> --server mx2.example.net -tls, confirm it waits with postqueue -p, then undo the deferral, enable the connector, and release the queue:
postconf -e "defer_transports ="
postfix reload
postqueue -f
Source: postconf(5) and postqueue(1), Postfix
In Exchange Online, confirm the message arrived from the relay and read its headers: X-MS-Exchange-SkipListedInternetSender should show the original sender’s address, not the relay’s (Enhanced Filtering for Connectors).
Get-MessageTraceV2 -StartDate (Get-Date).AddHours(-2) -EndDate (Get-Date) -FromIP <relay-public-ip>
Source: Get-MessageTraceV2, Microsoft Learn
Disable the connector again at the end of the window.
During an outage
- Confirm it is a provider outage and which part is down: R3 Mail not flowing.
- Design A: check the gateway’s queue or spooling alert. Start or confirm the continuity event as the vendor documents. Tell users by SMS or phone where the continuity inbox is and that it is for urgent mail only.
- Design B: check the relay is queueing (
postqueue -p) and its disk. Enable the pre-staged connector only when the relay starts delivering. If you cannot connect to Exchange Online PowerShell, the relay keeps queueing anyway. - Do not change MX, SPF or DMARC under pressure. Do not delete anything from a queue.
Fail back
- Watch the queue drain. For Mimecast, if you paused the delivery queue, unpause it; its docs say to check the delivery route afterwards (Managing Continuity Events).
- End the continuity event. Tell users to go back to Outlook and to stop sending from the continuity inbox.
- Check with message trace that queued mail arrived.
- Design B: disable the connector again, so it is not permanent extra trust into the tenant.
- Write down start, end, queue peak and anything that bounced.
What good and bad look like
- Good: in the rehearsal, the outside test message waits in the queue, appears in Exchange Online when the window ends, and the reply from the continuity inbox arrives with SPF or DKIM aligned and DMARC passing.
- Good, design A: a message sent directly to the Exchange Online host from anywhere other than the gateway is rejected.
- Bad: the backup relay accepts mail for an address that does not exist. It will later bounce it to a forged sender (backscatter) and fill its own queue.
- Bad: messages from the relay or gateway arrive in Exchange Online with the relay’s IP as the sender’s source, and SPF fails. Enhanced Filtering is not working.
- Bad: the continuity inbox sign-in sends people to the Microsoft sign-in page. It will not work if Entra ID is part of the outage.
Traps
- Any sender can use any MX. A backup MX is listed in public DNS, so anyone can deliver to it at any time, not only when Exchange Online is down. Treat it as a full front door with the same filtering.
- Partial outages skip the backup. If Exchange Online still answers on port 25 and accepts mail, but mailboxes are slow or broken, senders never try the backup. Only design A’s continuity inbox or a prepared MX swap helps then.
- DNSSEC and DANE. If your domain uses Exchange Online’s inbound DANE with DNSSEC, Microsoft’s guide assumes no secondary MX. Under DANE, an MX host without its own DNSSEC-signed TLSA records gets only ordinary opportunistic TLS (RFC 7672, 2.2.1), so a backup MX weakens the protection DANE was meant to give. Plan any secondary MX with your Exchange Online admin first, or use design A and ask the gateway vendor about their own DANE support.
- MTA-STS. If you publish an MTA-STS policy, it must list every MX host in its
mxlines (RFC 8461, 3.2). A backup MX missing from the policy will be refused by senders that enforce it. - Lockdown versus backup. Design A locks Exchange Online to the gateway. Design B cannot. Do not copy the lockdown connector into design B, or all normal mail is rejected.
- Bypass rules. A mail flow rule that sets spam confidence to bypass for the gateway’s IPs turns off most of Microsoft’s protection, and those IPs are shared with other customers. Use Enhanced Filtering instead.
- Outbound reality. Exchange Online being down means Outlook cannot send. A continuity inbox or a separate send path covers a few people sending plain mail. It does not cover shared mailboxes, calendars or Teams. Replies to that mail come back through your normal MX and wait in the queue like everything else.
- Short vendor queues. A four day or seven day queue is shorter than a long outage. Know your vendor’s limit and its pause option before the night you need it.
Undo
Design A, in this order. While the lockdown connector is on, Exchange Online rejects any message that did not come in through the gateway. Microsoft: “Any messages that are smart-host routed directly to Exchange Online will be rejected” (Microsoft Learn). If you switch the MX back first, every sender that already has the new MX record delivers straight to Exchange Online, is rejected, and gets a bounce. That lasts for the whole TTL window.
First, turn the lockdown off. Set the restriction to $false on the lockdown connector, or remove the connector.
Set-InboundConnector -Identity "Reject mail not routed through gateway" -RestrictDomainsToCertificate $false
Source: Set-InboundConnector, Microsoft Learn and Remove-InboundConnector, Microsoft Learn
If you used the IP address version, set -RestrictDomainsToIPAddresses $false instead.
Then switch the MX back to the Exchange Online host you recorded in step 1 (lower the TTL first). Keep the gateway accepting and relaying mail for at least the old TTL plus a safety margin, so mail that still arrives at the gateway is delivered and none is rejected. Remove the vendor’s SPF include and DKIM key only when no more mail is expected from the vendor.
Design B: remove the backup MX record, wait out the TTL, let the relay queue drain to zero, then remove the connector and switch the relay off.
Rehearsal: undo defer_transports and disable the connector, as in the rehearsal steps above.
Record it
Example included. The row marked Example is made up to show the format. Delete it and add your own rows.
| Date | Design | What was rehearsed | Queued and drained? | Reply passed DMARC? | Problems found | Initials |
|---|---|---|---|---|---|---|
| Example: 2026-12-05 | A, gateway | Continuity event, 30 minutes | Yes, 1 test message | Yes, DKIM aligned | Continuity sign-in went to the Microsoft page; switched admin to cloud password | AB |