Reason:If you receive this error then it means that your mail server is unable to connect to your smtp provider most probably due to firewall. So check your firewall and if your server is listening to port 25, 587 and 465 which are the smtp ports unless you have specified some custom port no.
# netstat -ntlp | grep sendmail tcp 0 0.0.0.0:587 0.0.0.0:* LISTEN 1419/sendmail tcp 0 0 0.0.0.0:465 0.0.0.0:* LISTEN 1419/sendmail tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1419/sendmailMany a times it happens that your network firewall might be blocking some particular port so you can check using telnet.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
and for port 465 uncomment below line
DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
You can use ssl ports by adding these two lines in your sendmail.mc file
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnlSave and exit your file
define(`ESMTP_MAILER_ARGS', `TCP $h 465')dnl
# m4 sendmail.mc > sendmail.cf
# service sendmail restart
For my configuration file you can refer this post
Now re-try to connect your SMTP server as in my case it is smtp.gmail.com using port no.
# telnet smtp.gmail.com 25 Trying 188.8.131.52... Connected to smtp.gmail.com. Escape character is '^]'. 220 mx.google.com ESMTP io2sm27316728pbc.24
Follow the below links for more tutorialsTutorial for Monitoring Tools SAR and KSAR with examples in Linux
What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
RAID levels 0, 1, 2, 3, 4, 5, 6, 0+1, 1+0 features explained in detail
How to configure Samba 4 Secondary Domain Controller
How to secure Apache web server in Linux using password (.htaccess)
How to register Red Hat Linux with RHN (Red Hat Network )
Red hat Enterprise Linux 5.5 Installation Guide (Screenshots)
15 tips to enhance security of your Linux machine
Why is Linux more secure than windows and any other OS
What is the difference between "su" and "su -" in Linux?
What is swappiness and how do we change its value?
How to log iptables messages in different log file
What are the s and k scripts in the etc rcx.d directories
How to check all the currently running services in Linux
How to auto start service after reboot in Linux
What is virtual memory, paging and swap space?
What is the difference between DNS A record and CNAME record?