A family member reported she was no longer able to send email via a Sendmail service I have running on a CentOS Linux system. She sent me a screenshot of the message she received when attempting to send a message. I saw a "Server error: '550 5.7.1 ... Relaying denied'" message. At first, I thought that a technician from her Internet Service Provider (ISP) might have changed her Microsoft Outlook settings when he upgraded her network equipment recently, but then I remembered I was restricting email relaying on the system by IP address and realized her IP address would have changed when the technician upgraded her network equipment. So I had her visit whatismyipaddress.com and provide me with the public IPv4 IP address it showed for her. I then replaced her prior IP address in
/etc/mail/access
. The format for an entry to allow relaying
from a particular IP address is as shown below.
# Jane Doe 192.168.71.77 RELAY
You can include a comment to indicate who the IP address is associated with by prefixing the comment with a pound sign. The IP address should be followed by the word "RELAY" (you can put tabs in between the IP address and the word, if you like).
After changing the IP address, I rebuilt the access database with the makemap command. I then restarted Sendmail
# makemap hash /etc/mail/access </etc/mail/access # service sendmail restart Redirecting to /bin/systemctl restart sendmail.service #
I was then able to receive a test message she sent me. After updating
the IP address, I may only have needed to restart Sendmail without running
the makemap command
first as I found the following at
19.3.2. Sendmail on a
Red Hat website in reference to running the
make all -C /etc/mail/
command (CentOS is derived from
Red Hat
Enterprise Linux):
All other generated files in
/etc/mail
(db files) will be regenerated if needed. The old makemap commands are still usable. The make command is automatically used whenever you start or restart thesendmail
service.