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
- Back up the /etc/postfix/main.cf file just in case. (This is an optional step.)
- Find you server's internal IP address with a command like this:
ip addr show | grep eth0 | grep inet | awk '{print $2}'
- 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
- Either reboot the server or run this command to have the changes take effect:
sudo postmap /etc/postfix/generic
Thank you ,This fixed my error