What the message looks like
550 5.7.1 <info@beispiel.de>: Relay access deniedCommon 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,mydestinationorrelay_domains. - The application server's IP is not in
mynetworks. - The receiving server (e.g. an Exchange receive connector) rejects the sender or IP by policy.
Check
- Show Postfix relay settings
postconf -n | grep -E 'mynetworks|relay_domains|smtpd_relay_restrictions|virtual_mailbox_domains' - Find rejected attempts and client IPs in the log
- 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 - Check that the submission ports are listening
ss -ltnp | grep -E ':(25|465|587) '
Fix
- Enable SMTP AUTH in the client and use port 587 with STARTTLS.
- Add your domains to
virtual_mailbox_domainsorrelay_domains, then runpostfix reload. - Set clean relay rules:
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination. - Add fixed internal servers to
mynetworksas single /32 entries – never whole networks. - If a remote server rejects you, read the full bounce text and clarify the named policy with the recipient's admin.
Typical scenario
A customer sets up info@example.com on a phone and enters mail.example.com as the outgoing server on port 25 with no login. The very first message to an outside address bounces. Postfix logs 'NOQUEUE: reject: RCPT from ...: Relay access denied'. First look at which SMTP phase triggers the rejection: if it already happens at RCPT TO, the problem is missing authentication or relay permission, not the message content.
FAQ
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.
Can I just widen mynetworks?
Only for single trusted hosts. Something like 0.0.0.0/0 turns the server into an open relay that ends up on blocklists within hours.
Does 'Relay access denied' mean my server was hacked?
No. It shows the server is behaving as a closed relay should. Many lines from unknown IPs are usually automated probing and harmless. The worrying case is the opposite: mail from strangers being accepted and forwarded.
Why does sending work in the office but not on the road?
Internal clients are often listed in mynetworks and may relay without logging in. From outside, the connection comes from a foreign network, where only permit_sasl_authenticated applies. The client therefore has to authenticate with SMTP AUTH.
Can I loosen the relay rules to make it work?
Not with broad exceptions such as a whole network or an unconditional permit. An open relay gets abused for spam quickly and ends up on blocklists. Authenticating on port 587, or adding one fixed IP to mynetworks, is the clean way.