550 5.7.1 and 554 5.7.1 Relay Access Denied: Causes and Fixes
550 5.7.1 and 554 5.7.1 Relay access denied mean a mail server refused to pass your message on because you aren't authorized. See the common causes, from missing SMTP login to the wrong port, and how to fix each.
By Jack MahoneyPublished
Use with your tools
Your app, printer, website form or mail client tried to send an email and got back 550 5.7.1 or 554 5.7.1 Relay access denied. The server you connected to refused to pass your message on. Nothing was delivered, and resending the same way will fail the same way.
The cause is almost always in how the sender connects, not in the message: the server doesn't know you're allowed to use it. This guide explains what the codes mean, the usual causes and how to check a fix before you rely on it.
What 5.7.1 and "relay access denied" mean
Enhanced status codes have three parts. The 5 means a permanent failure. The 7 is the security or policy class, and 5.7.1 is defined in RFC 3463 as delivery not authorized, message refused: the sender isn't authorized to send to that destination, because of a rule on the server about the sending host or the recipient.
"Relaying" is a server passing mail on to a domain it doesn't host. A mail server accepts mail for its own domains from anyone, but it only relays to other domains for senders it trusts, usually clients that have signed in with SMTP authentication or connect from an approved network. A server that relayed for anyone would be an open relay, and spammers would use it. So when an unauthenticated client asks the server to deliver to someone@gmail.com, the server refuses with "Relay access denied".
The leading 550 or 554 is the basic SMTP reply. Both are permanent. 550 covers a refused mailbox or a command rejected for policy reasons, and 554 is a failed transaction. Which one you see depends on the server software, not on a different cause.
The common causes
Your app or device isn't signing in
This is the most frequent cause. The SMTP settings have the right server but no username and password, or authentication is switched off, so the server treats the connection as anonymous. Turn on SMTP authentication and use the account credentials the provider gave you.
You're using the wrong port
Port 25 is for server-to-server delivery, and many servers listening there only accept mail for their own domains. Applications should normally submit mail on port 587 with STARTTLS, where authentication is expected. Our SMTP port guide compares 25, 465, 587 and 2525.
Your IP address isn't on the relay's allowed list
Some setups, such as a scanner or line-of-business app relaying through an on-premises Exchange server, rely on an allowed IP address instead of a login. If the device moved to a new network or IP address, the server no longer recognises it. Add the new address to the relay's allowed list, or switch the device to authenticated submission.
The From address isn't one you're allowed to send as
Some providers refuse to relay mail whose From or envelope sender is a domain your account doesn't own. Send from an address on a domain that's verified with that provider.
The receiving server blocked you by policy
Not every 5.7.1 is about relaying. The same code is used when a recipient's server refuses mail by rule, for example a sender on a blocklist or a recipient that only accepts mail from certain senders. If the bounce text mentions a blocklist, spam or a policy instead of relaying, check your domain and IP reputation instead.
Check the fix before you rely on it
- Run the free SMTP tester against the server and port your app uses. It records the server's greeting banner, tries STARTTLS and tests SMTP authentication with the credentials you give it, then shows the transcript step that failed.
- Send a real message from your application to an address you can read. A MailSlurp test inbox lets an automated test wait for that email and check what arrived, so the next configuration change is caught in CI rather than by a customer.
- If you run the server yourself, check its relay rules. In Postfix, for example, the usual relay policy permits trusted networks and authenticated clients and then rejects mail for other destinations with
reject_unauth_destination.
Frequently asked questions
What does 550 5.7.1 mean?
The server refused the message because the sender isn't authorized to send to that destination. Most often the client didn't authenticate before asking the server to relay mail to another domain; sometimes the recipient's server rejected the sender by policy.
How do I fix 554 5.7.1 Relay access denied?
Turn on SMTP authentication with valid credentials, submit on port 587 with STARTTLS, and send from an address on a domain your account is allowed to use. If you relay by IP address, add the sending machine's current IP to the server's allowed list.
Is 5.7.1 a temporary error?
No. Codes starting with 5 are permanent failures. The message won't be delivered by retrying until the sending setup changes.
Is "relay access denied" a spam problem?
Usually not. It means the server won't pass your message on for you. A 5.7.1 that mentions a blocklist or spam is a separate reputation problem.