SMTP error · Any server
550 5.7.1 / 554 5.7.1: Relay access denied
554 5.7.1 <user@example.com>: Relay access denied
IP addresses, domains and links in the line differ per message, and a long reply may be split over several lines.
What it means
You asked a mail server to deliver a message to a domain it is not responsible for, and it does not know you well enough to pass the message on. Mail servers relay only for users who have logged in or who connect from a trusted network. Otherwise spammers would use them.
The exact line depends on the software. Postfix sends "554 5.7.1 <address>: Relay access denied", or 454 4.7.1 with the same text. Sendmail sends "550 5.7.1 Relaying denied". Exchange sends "550 5.7.54 SMTP; Unable to relay recipient in non-accepted domain". They all mean the same thing.
Usual causes
- Your email program or application sends without SMTP authentication.
- You connect to port 25 on the server. Submission with a login belongs on port 587, or 465 with TLS.
- The username or password is wrong, so the server treats you as anonymous.
- Your application's IP address is not in the server's list of trusted networks.
- The recipient's MX record points to a server that is not set up to accept mail for that domain.
- You are sending to the wrong SMTP server altogether.
How to fix it
-
Work out who is refusing
If your own email program or application shows the error when you send, the problem is between you and your outgoing server. If it comes back later as a bounce from the recipient's server, the recipient's domain is set up wrongly.
-
Turn on SMTP authentication
In your email program or application, enable "my outgoing server requires authentication" and enter the username and password or API token your provider gave you.
-
Use the submission port
Set the port to 587 with STARTTLS, or 465 with implicit TLS. Port 25 is for server-to-server delivery and normally does not accept logins.
-
Check the server name
Make sure the SMTP host is the one your provider documents. A typo can land you on a server that has never heard of you.
-
If you run the server
In Postfix, check that smtpd_relay_restrictions contains permit_mynetworks, permit_sasl_authenticated and reject_unauth_destination in that order, and that mynetworks lists only your own machines. Never fix this by allowing everyone: that creates an open relay.
-
If the recipient's server refuses
Tell the recipient. Their MX record points to a server that does not list their domain as one it accepts mail for. Only they or their host can change that.
Related errors
- 550 5.4.1: Recipient address rejected: Access denied (Microsoft 365) permanent
- 554 5.7.1: Message rejected for policy reasons or as spam permanent
- 535 5.7.8: Authentication failed (SMTP login) permanent
Rather not do DNS by hand?
Buzzmark is EU-hosted transactional email that generates your SPF, DKIM, DMARC and Return-Path records, checks them for you and warns you if they ever drift.
Free up to 300 emails a month · No credit card