Email errors
550 5.7.1 relaying denied: what it means and how to fix it
550 5.7.1 relaying denied means a mail server refused to forward your message. Find out if the cause is sign-in, an MX record or a relay allowlist.
What this means
A 550 5.7.1 relaying denied bounce means the mail server refused to forward your message to its next destination. Relaying is when a server accepts mail for a domain it does not host and passes it on.
The wording depends on the server:
- Sendmail:
550 5.7.1 <rcpt@example.com>... Relaying denied - Postfix:
Relay access denied - Exim:
relay not permittedin the default configuration - Exchange Online:
Unable to relayunder5.7.1, or550 5.7.64 TenantAttribution; Relay Access Denied - Google Workspace:
Invalid credentials for relayunder550 5.7.1
When 550 5.7.1 means something else
RFC 3463 defines 5.7.1 as Delivery not authorized, message refused, so servers use it for many policy refusals. Other refusals need different fixes, so read the text after the code.
Why it happens
A server relays only for clients it trusts, or for domains it is set up to handle. The usual causes are:
- The sender did not sign in. An app, printer or mail client connected without authentication, or from an IP address the server does not trust.
- The MX record points to the wrong server. An MX record names the server that receives mail for a domain. A stale record can send mail to a server that does not accept the domain.
- A relay rule no longer matches. A certificate or sending IP changed and no longer matches the connector or IP list (Microsoft 365:
TenantAttribution).
How to fix it
- Find the server that refused. Read the bounce's diagnostic section, because the server that wrote the bounce can differ from the one that refused.
- If an app, device or mail client sends through that server, even your provider's, set it to sign in (SMTP authentication) over TLS on port 587. In Microsoft 365, use
smtp.office365.comwith OAuth. In Google Workspace, configure SMTP relay under Apps > Google Workspace > Gmail > Routing and point the device tosmtp-relay.gmail.com. - If the device cannot sign in, authorize only its IP address:
mynetworksin Postfix,relay_from_hostsin Exim (keep localhost in both), the access map in Sendmail, an inbound connector with a static IP or certificate in Microsoft 365 (then point the device to your domain's MX endpoint on port 25 and add the sending IP to your existing SPF record; never publish a second SPF record), or the IP list in Google's SMTP relay setting. If an authorized certificate or IP changed, update the connector or IP list. Caution: keep the range small. A server that relays for strangers can be used for spam. - If the recipient or a third party runs that server, forward the full bounce to its administrator.
- If mail sent to your domain bounced, run an MX lookup on the domain and compare the result with the server that refused. If the record names an old host, correct it. Caution: an MX change reroutes all inbound mail for the domain, so confirm first that the new server accepts the domain.
- If mail sent to your domain bounced and the MX record correctly names the server that refused, add the domain on that server. If this server stores the mailboxes, use
mydestination(system accounts) orvirtual_mailbox_domains(virtual mailboxes) in Postfix,local_domainsin Exim or classwin Sendmail. If it forwards to another server, userelay_domainsin Postfix,relay_to_domainsin Exim, or classRor the access map withRELAYin Sendmail, and set the domain's next hop (in Postfix, atransport_mapsentry with the host in brackets). Without one, a primary MX routes the mail back to itself. In Microsoft 365, confirm the domain shows as Healthy under Settings > Domains.
Confirm the fix
- If you changed an MX record, wait for the old TTL (how long resolvers may cache the answer), then repeat the lookup.
- Reload the server if you edited its configuration (Postfix:
postmapfor map files, thenpostfix reload). Send a new message along the path that failed. - In Microsoft 365, run the Inbound SMTP Email and Outbound SMTP Email tests in the Microsoft Remote Connectivity Analyzer.
- If you widened the relay rules, test from outside your network without signing in. Send to a domain the server does not host. It must still refuse.