LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Could not open connection to the host, on port 25 Ubuntu (https://www.linuxquestions.org/questions/linux-newbie-8/could-not-open-connection-to-the-host-on-port-25-ubuntu-4175556554/)

jojanmpaul 10-19-2015 06:09 AM

Could not open connection to the host, on port 25 Ubuntu
 
Hello,

I am not able to do telnet from local machine to the server, but able to ping and ssh. I am not able to send mail using smtp mail server install on the server. Please suggest me on the same.

C:\Users\Jojan>telnet 191.167.1.171 25
Connecting To 192.168.1.145...Could not open connection to the host, on port 25:
Connect failed

root@portal:~# telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 portal.ussoftwaregroup.com ESMTP Sendmail 8.14.4/8.14.4/Debian-4.1ubuntu1; Mon, 19 Oct 2015 16:29:56 +0530; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]

netstat -tlnp | grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 7354/sendmail: MTA:

MensaWater 10-19-2015 08:06 AM

On the host you're trying to reach run "lsof -i :25" to see what is LISTENing on port 25. Verify it shows either * or the specific IP/hostname on this host that you're using for inbound connections LISTENing. (The * means it is LISTENing on all interfaces.)

Since you say it worked from localhost but not from an external system the most likely issue is that you don't have port 25 open in your firewall at host level (e.g. iptables or firewalld). If you have a firewall device between the two hosts you'd also want to make sure the port is open in that device as well.

Typically your host level firewall allows outbound connections by default but controls inbound though you can even lock outbound.

chrism01 10-19-2015 07:09 PM

By default (for security) sendmail installs to only listen on localhost (as shown by your netstat cmd). Use this http://www.cyberciti.biz/tips/sendma...ions-from.html to enable listening on all interfaces.


All times are GMT -5. The time now is 05:54 PM.