P H O T O N

CONSOLE

Loading

SMTP Error Resolution Guide

How to Fix 'SMTP 550 5.7.1 Relay Access Denied'
Step-by-Step Server & Client Configuration Fix

Diagnose SMTP authentication mismatches, configure Postfix SASL authentication, and route mail through authenticated smart host relays without getting rejected.

5 min read • Linux, Postfix, Exim • Production Code
Direct Answer: Fixing 550 5.7.1 Relay Access Denied

The '550 5.7.1 Relay Access Denied' error occurs when the receiving mail server rejects an outgoing email because the sender did not authenticate via SMTP AUTH (SASL), or the server is not configured as an open relay for that IP address.

1. What Does '550 5.7.1 Relay Access Denied' Mean?

In standard SMTP (RFC 5321), a mail server acts as a relay when it accepts an email from an external client or application and forwards it to an external third-party mailbox (such as Gmail, Yahoo, or Outlook).

To prevent malicious spammers from hijacking servers to broadcast unauthenticated junk, modern mail transfer agents (MTAs) disable open relaying by default. When an application attempts to inject an email without valid credentials or from an unwhitelisted IP, the server responds with:

550 5.7.1 <recipient@example.com>: Relay access denied

2. Top 3 Root Causes of Relay Rejections

1. Missing SMTP AUTH

Your application (WordPress, Laravel, Node.js) sent the email over port 25 without sending AUTH LOGIN or AUTH PLAIN credentials.

2. Unwhitelisted IP

Your server's outgoing IP address is not listed in your mail server's mynetworks configuration directive.

3. Port 25 Cloud Filter

Your cloud host (AWS, DigitalOcean, Linode) intercepts outbound port 25 traffic and routes it to an unauthenticated gateway.

3. Step-by-Step Fix in Postfix (Ubuntu / Debian / RHEL)

If your Linux server runs Postfix as a local MTA and needs to forward all outgoing mail through an authenticated smart host relay, follow this 3-step configuration:

Step 1: Edit /etc/postfix/main.cf

# Set smart host relay with explicit port 587 relayhost = [mail.photonrelay.com]:587 # Enable SASL authentication smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_sasl_tls_security_options = noanonymous # Enforce TLS encryption smtp_use_tls = yes smtp_tls_security_level = encrypt smtp_tls_note_starttls_offer = yes

Step 2: Create Credentials File /etc/postfix/sasl_passwd

[mail.photonrelay.com]:587 YOUR_SMTP_USERNAME:YOUR_SMTP_PASSWORD

Step 3: Hash Passwords, Secure Permissions & Restart

sudo chmod 600 /etc/postfix/sasl_passwd sudo postmap /etc/postfix/sasl_passwd sudo systemctl restart postfix

4. Verifying Authentication with OpenSSL & Telnet

Test that your server can establish an authenticated TLS handshake on port 587:

openssl s_client -starttls smtp -connect mail.photonrelay.com:587 -crlf # Once connected, verify available auth mechanisms: EHLO yourdomain.com # Server response will include: 250-AUTH PLAIN LOGIN 250 STARTTLS

Eliminate 550 Relay Errors Forever

Connect your applications to Photon Console's Anycast edge relay. Sub-second delivery, 5,000 free monthly dispatches, and instant credential provisioning.

Get Free Relay Credentials in 2 Mins →

5. Connecting to Photon Console's Authenticated Edge Relay

Photon Console provides high-performance, authenticated SMTP relay clusters specifically engineered to replace fragile local sendmail configurations:

  • Port 587 STARTTLS Support: Full RFC 6409 compliance, completely avoiding cloud host port 25 blockades.
  • Zero IP Whitelist Restrictions: Authenticate securely from dynamic cloud IPs, Kubernetes pods, or local dev machines.
  • Real-Time Delivery Logs: Searchable 30-day message logs with exact SMTP response codes (250, 451, 550) for immediate debugging.

6. Frequently Asked Questions

Mail servers accept local delivery for their own hosted domains without authentication, but strictly require verified SMTP authentication (SASL) before forwarding messages to external destination domains like Gmail, Outlook, or Yahoo.

In /etc/postfix/main.cf, configure relayhost = [mail.photonrelay.com]:587, enable smtp_sasl_auth_enable = yes, populate credentials in /etc/postfix/sasl_passwd, run 'postmap /etc/postfix/sasl_passwd', and restart Postfix via 'systemctl restart postfix'.

Yes. Port 25 is intended strictly for server-to-server MX transfer and is frequently blocked by cloud hosts. Port 587 requires explicit STARTTLS authentication (RFC 6409) and prevents open relay rejections.