Errors

554 5.7.1 Relay access denied: what it means and how to fix it

Short answer

Relay access denied means you asked an SMTP server to deliver mail to a domain it does not host, and it does not recognize you as an allowed sender. Postfix's default reply is 554 5.7.1 <address>: Relay access denied. The fix is almost always to authenticate with SMTP AUTH on port 587 or 465 before sending, or to send through the server that is meant to relay for you. It is permanent: retrying unchanged will not work.

Last checked 16 November 2026

“Relay access denied” means you asked an SMTP server to deliver mail to an outside domain, and it does not trust you to do that. Open relays were abused by spammers for years, so servers relay only for clients that log in or sit on trusted networks. Log in, or use the right server, and the error goes away.

554 5.7.1 <recipient@example.org>: Relay access denied

Microsoft Exchange Online reports the same idea as 5.4.1 Relay Access Denied or 5.7.1 Unable to relay.

What it means

The 554 is “Transaction failed” in RFC 5321, and 5.7.1 is “Delivery not authorized, message refused” in RFC 3463. In Postfix this exact text comes from the reject_unauth_destination restriction. The server accepts mail for domains it hosts from anyone, but for any other destination the client must be in mynetworks or authenticated.

Why it happens

  • Your mail app or code does not log in. The SMTP settings have authentication off, so the server sees an anonymous client.
  • You are using port 25. Many servers only offer authenticated submission on 587 or 465, and treat port 25 as server to server.
  • Wrong server. You pointed your app at the recipient’s mail server, or a server that is not yours, and asked it to send elsewhere.
  • Your IP changed. The server trusted your old office IP in mynetworks, and you now send from somewhere else.
  • Broken MX on the receiving side. A domain’s MX record points to a server that does not list that domain as accepted, so even normal inbound mail is treated as relaying. Microsoft lists this as a cause of its 5.4.1 and 5.7.1 relay errors.

How to fix it

  1. Turn on SMTP authentication in your client or code, and use the same username and password your provider gives you for sending.

  2. Use a submission port: 587 with STARTTLS or 465 with implicit TLS. See SMTP ports.

  3. Check the host name. It should be your provider’s outgoing SMTP server, not the recipient’s.

  4. Running Postfix? For your own users, enable SASL and allow authenticated clients before the reject:

    smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

    Never remove reject_unauth_destination to “fix” this: that makes you an open relay.

  5. Receiving domain owner: make the MX record point to a server that accepts mail for the domain, and add the domain to that server’s accepted domains.

  6. For app email, use an SMTP relay service or email API with an API key, so you never depend on a mailbox password or office IP. See SMTP relay services.

Which server sent it

  • Postfix sends 554 5.7.1 <address>: Relay access denied by default (the code is set by relay_domains_reject_code).
  • Microsoft Exchange Online documents 5.4.1 Relay Access Denied, where the server does not accept mail for the recipient’s domain, and 5.7.1 Unable to relay, in its NDR reference.
  • Google Workspace SMTP relay says 550 5.7.0 Email relay denied or 550 5.7.1 Invalid credentials for relay when your IP or domain is not registered in the relay settings.
  • Gmail and Yahoo inbound do not normally send this: they accept mail for their own users from anyone who passes their checks.

Is it temporary?

No. It is a 5xx permanent refusal, and the server will refuse the same unauthenticated attempt every time. Change your settings, then resend. The recipient address is fine, so do not suppress it because of this error.

How Mailcandor handles it

Mailcandor’s SMTP relay at smtp.mailcandor.com relays to any recipient once you log in with the username mailcandor and an API key as the password, on port 465 or 587. The API needs no SMTP at all. When a message does bounce, the deliverability coach explains it in plain English and hard bounces are suppressed automatically. The free bounce code lookup decodes any reply, the error library covers each code, our SPF, DKIM and DMARC guide handles authentication, and the tools page has more free checks.

Questions

What does relay access denied mean?

The server only accepts mail for its own domains from strangers, and only relays to other domains for clients that log in or come from trusted networks. You were neither.

How do I fix relay access denied in Outlook or Thunderbird?

Turn on 'My outgoing server requires authentication', use port 587 with STARTTLS or 465 with SSL/TLS, and enter the same username and password as for incoming mail.

Why does Postfix say relay access denied?

The reject_unauth_destination restriction refused a recipient outside relay_domains from a client not in mynetworks and not authenticated with SASL.

Can relay access denied come from the recipient's server?

Yes, when a domain's MX record points to a server that does not accept mail for that domain. The domain owner must fix the MX record or the server's accepted domains.

Related

Send with someone on your side.

Unlimited domains on every plan, a person before any block, and 3,000 emails a month free. Tell us what you send and we set you up within one business day.