I hate mail problems they are not so easy to handle can spend up to days trying to fix mail issues. Most times related to dns or host resolution issues in /etc/hosts file or /etc/nsswitch.conf
from that server where you run the command is it allowed to send email to go out to internet?
do command
nslookup google.com
if cannot check /etc/resolv.conf if there are nameservers there check in /etc/nsswitch.conf if there is an entry
hosts: files dns
if you are only allow relay from this server to another server
1) what is your sendmail.cf DS pointing to? example DSsomemail means it's relaying to somemail server
try to telnet to the mail server at smtp port 25 send email from it see if you can receive.
root# telnet somemail 25
Trying somemail...
Connected to somemail.
Escape character is '^]'.
220 somemail ESMTP Postfix
mail from: darthvader
250 2.1.0 Ok
rcpt to:
someone@gmail.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
test
test
.
250 2.0.0 Ok: queued as 16FA7160BA3
quit
221 2.0.0 Bye
Connection to somemail closed by foreign host.
if you can telnet and send email and receive it means it's could be some relaying configuration issues. If you cannot means there's also some other issue network dns firewall
I hate mail issues.