How Do You Troubleshoot the Postfix Error “454 4.7.1 jdoe@acme.com: Relay access denied”?

Problem scenario
You are trying to send an email on a Postfix server. But you keep getting this error: "454 4.7.1 jdoe@acme.com: Relay access denied"

What should you do?

Solution

  1. Back up the /etc/postfix/main.cf file just in case. (This is an optional step.)
  2. Find you server's internal IP address with a command like this: ip addr show | grep eth0 | grep inet | awk '{print $2}'
  3. Modify the /etc/postfix/main.cf file. Go to the "mynetworks" stanza. Verify you see the server's IP address there with a shorthand notation of a relevant subnet mask (e.g., a CIDR). It should look something like this:

172.5.4.0/24 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

  1. Either reboot the server or run this command to have the changes take effect: sudo postmap /etc/postfix/generic

Join the Conversation

1 Comment

Leave a comment

Your email address will not be published. Required fields are marked *