DEV Community

Cover image for Incident note: SMTP 550 5.7.1: Relay access denied – causes & fix
Daniele Michelin
Daniele Michelin

Posted on Originally published at daniele-michelin.com

Incident note: SMTP 550 5.7.1: Relay access denied – causes & fix

Read the signal

Start with the exact wording of the error and its timestamp in the log. Then narrow down the cause before changing anything.

550 5.7.1 <info@beispiel.de>: Relay access denied
Enter fullscreen mode Exit fullscreen mode

Narrow down possible causes

  • The mail client or application sends without SMTP AUTH.
  • Mail is submitted on port 25 instead of submission port 587 (or 465) with login.
  • The recipient domain is missing from virtual_mailbox_domains, mydestination or relay_domains.
  • The application server's IP is not in mynetworks.

Check before changing anything

1.

Show Postfix relay settings

postconf -n | grep -E 'mynetworks|relay_domains|smtpd_relay_restrictions|virtual_mailbox_domains'
Enter fullscreen mode Exit fullscreen mode

2.

Find rejected attempts and client IPs in the log

journalctl -u postfix --since '1 hour ago' | grep 'Relay access denied'
Enter fullscreen mode Exit fullscreen mode

3.

Test authenticated submission on port 587 (prompts for the password)

swaks --to test@example.com --from info@example.com --server mail.example.com --port 587 --tls --auth LOGIN --auth-user info@example.com
Enter fullscreen mode Exit fullscreen mode

4.

Check that the submission ports are listening

ss -ltnp | grep -E ':(25|465|587) '
Enter fullscreen mode Exit fullscreen mode

Fix and test again

  1. Enable SMTP AUTH in the client and use port 587 with STARTTLS.
  2. Add your domains to virtual_mailbox_domains or relay_domains, then run postfix reload.
  3. Set clean relay rules: smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination.
  4. Add fixed internal servers to mynetworks as single /32 entries – never whole networks.

Then repeat the original action and compare the result with the initial error.

Keep a note for the next ticket

Record the exact error, the check result, the change and the retest. That gives the team a useful starting point next time.

Does 550 5.7.1 always mean relay access denied?

No. 5.7.1 is a generic policy code. Microsoft 365, spam filters and sender restrictions use it too. The text after the code tells you what actually happened.

Full error guide: SMTP 550 5.7.1: relay access denied and policy rejections


Originally published at daniele-michelin.com. More guides, free checks (SPF, TLS, headers) and an error-message lexicon: daniele-michelin.com/en/.

Top comments (0)