Thanks for the reply.
My other servers only listen on localhost (since that was the default setup from the install of sendmail) and they are able to sendmail. How do I configure sendmail to listen on a specific IP? By specific IP, do you mean the rocky linux box’s IP?
OK, it wasn’t clear from your telnet command as you X’d out the IP address. You could have just left it as localhost or 127.0.0.1 since it’s not a risk.
telnet smtp.xxx.xxx 25
resolves to localhost, then if you are getting service not available then it means you have misconfigured sendmail. If you copied sendmail config files from RHEL7 to Rocky 8 or 9 then you shouldn’t do that. You should just edit the one supplied by the distribution and add the configuration you need manually. If you didn’t do this, then you’ll need to check the sendmail configuration and fix it. Check /var/log/messages or /var/log/maillog for errors after restarting sendmail.
If you are only going to use the server locally, then leaving it on localhost is OK. If you want to send to the world though, then you shouldn’t be doing it that way. SMTP servers will usually be checked against DNS and PTR records, and if they are not matched or inaccessible, then your mail maybe rejected.
Since we don’t have enough information about your configuration or what you are attempting to do, it’s almost impossible to help. Please post a lot more information including the steps you have done to install/configure sendmail on the machine it is failing on.
@iwalker I did not copy RHEL7 config files to the rocky box, I edited the supplied file /etc/mail/sendmail.mc from the install of sendmail by defining the SMART_HOST, which I defined with the same smtp.xxx.xxx as on the working server.
No other files were edited when I set up the RHEL7 server.
maillog has the following. Does this mean the server is not “known” on the network? sendmail: My unqualified host name (xxxxxxsrv) unknown; sleeping for retry
Yeah, this is where I mention issues with running SMTP servers on localhost. SMTP Servers accepting emails from other SMTP servers do actually prefer to be able to get a connection to that server. In fact some will drop your connection and not allowing send/receive if they cannot connect to you. Some servers also do sender verification before accepting emails. This means they connect to your server via SMTP to check/verify if that email address exists before accepting it. Also if the server sending doesn’t have a proper FQDN then it can also be rejected.
It could well be because your server doesn’t have a fully qualified hostname in the format of server.yourdomain.com then you can have issues sending emails from it. So you would need to fix that first, considering the errors in your log files. And you may have to reconfigure sendmail to listen on 0.0.0.0 or the IP address of the server instead of localhost. But you’ll only know that once you go through the server configuration and attempt to send emails, and see whether it is accepted or not via the server you are attempting to relay to. The other question is, do you need to provide a username/password to connect to that SMTP server to relay emails? That could also be a problem.
On your RHEL7 box, do:
to find out the hostname and FQDN and do the same on the other server that doesn’t work.