Link to home
Start Free TrialLog in
Avatar of lilyyan
lilyyan

asked on

Connect Failed : ?? telnet localhost 25

Hello, experts:

I'm testing SMTP service in my pc:

IIS is enabled in my pc. In MS outlook express, when I go to tools--> accounts-->add (a mail account ), in the incoming mail server option, i  choose IMAP( i also tried pop3). In  the outgoing and incoming server name option, i input localhost for both.

when i try to send an email, i got the following error:
-------------------------
Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. Account: 'localhost', Server: 'localhost', Protocol: SMTP, Port: 25, Secure(SSL): No, Error Number: 0x800CCC0F
------------------------


I also did another test. When I set up another mail account in MS outlook express, in  the outgoing and incoming server name option, i input imap.myschool.edu and smtp.myschool.edu respectly, this time, i can send and receive emails.

Then in dos command , I tried to telnet localhost 25, it give this error:
Connecting To localhost...Could not open connection to the host, on port 25: Connect failed

I also tired : telnet smtp.myschool.edu, and got the same error.
My pc has windows firewall intalled and vrius scan.

Any suggestion,

Thanks for your attetion.
SOLUTION
Avatar of srikrishnak
srikrishnak
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lilyyan
lilyyan

ASKER

when i type netstat -na

i got the following:
-----------------------------------------
Proto  Local Address          Foreign Address        State
TCP    0.0.0.0:25             0.0.0.0:0              LISTENING
TCP    0.0.0.0:80             0.0.0.0:0              LISTENING

........
----------------------------------

port 25 is listening. so i guess the SMTP service is started and running.

my pc has Norton Internet Security Antivirus, Firewall, Antispan.

when i try to open port 25. in the firewall panel, i got the message saying that: this port is already opened.

but why i can't do telnet  localhost 25 ?

how to check Virus Scan contains any inbuilt Firewall ?

Appreciate your attention
Okies...then we can say the SMTP service is running fine....In the case how about tryin to telnet on the IP address of your machine...(Localhost must work..but sometimes I observed because of the web server settings i could access my website with localhost)...
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
most vendors do not like to use personal firewall on servers or systems acting as servers.

There are dedicated software for servers eg AV, firewall, IDS etc. If you try to use personal AV, Firewalls for PC's and then try to act as a server, you will find issues for sure becuase the nature of the personal stuff is to block everything and protect not just yourself but those around you also.


Avatar of lilyyan

ASKER

Hi, thanks all attention. The problem is solved. As Ruudsje said, port 25 is blocked by antivirus. After unblocked, now it's working. (i'm implementing a mail function).

Srikrishnak, in your posting : Localhost must work..but sometimes I observed because of the web server settings i could access my website with localhost

so you can or can't access website with localhost?

now i can't telnet localhost  or telnet localhost 25.
it shows:
Connecting To localhost...Could not open connection to the host, on port 23: Connect Failed.

before unblocking port 25, i can at least telnet localhost

i will still open the above question for a while, since there is still some puzzel. :)
Avatar of lilyyan

ASKER

update the above post a little bit:

when i type telnet localhost
it shows:
Connecting To localhost...Could not open connection to the host, on port 23: Connect Failed.

when i type telnet localhost 25
nothing show up. and the dos screen just back to the my home directory. looks like i typed cd ..

before unblocking port 25, i can at least telnet localhost
you might need to restart your server or check smtp is listening on all ip addresses (unassigned)....this should work

a Normal telnet (thus on port 23) works only is you have telnet services installed on that server

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lilyyan

ASKER

Hi, thanks fo reply.  My pc has telnet service. and i can telnet to other ip ( if i have an account on that ip). but i can't do: telnet localhost. and i can telnet smtp.myschool.edu 25 , but i can't telnet localhost 25.

the follwoing is port info. in my pc, it looks like : smtp is listening on all ip addresses (unassigned)

Proto  Local Address          Foreign Address        State
TCP    0.0.0.0:25             0.0.0.0:0              LISTENING
TCP    0.0.0.0:80             0.0.0.0:0              LISTENING
TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
TCP    0.0.0.0:443            0.0.0.0:0              LISTENING
TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
TCP    0.0.0.0:1025           0.0.0.0:0              LISTENING
TCP    0.0.0.0:3306           0.0.0.0:0              LISTENING
TCP    0.0.0.0:5225           0.0.0.0:0              LISTENING
TCP    0.0.0.0:5226           0.0.0.0:0              LISTENING
TCP    0.0.0.0:8008           0.0.0.0:0              LISTENING
TCP    0.0.0.0:12001          0.0.0.0:0              LISTENING
TCP    127.0.0.1:25           127.0.0.1:1310         TIME_WAIT
TCP    127.0.0.1:25           127.0.0.1:1312         TIME_WAIT
TCP    127.0.0.1:25           127.0.0.1:1313         TIME_WAIT
TCP    127.0.0.1:25           127.0.0.1:1314         TIME_WAIT
TCP    127.0.0.1:25           127.0.0.1:1315         TIME_WAIT
TCP    127.0.0.1:25           127.0.0.1:1316         TIME_WAIT
TCP    127.0.0.1:1028         0.0.0.0:0              LISTENING

the pc i'm using has windows firewall and antivrus. i guess it's not personal edition. it comes with the windows xp pro.
just wanna know sth new ;)  thanks.


telnet service (port 23) is not listening on any ip neither 127.0.0.1 -> so telnet localhost will not work
telnet 25 (mail) is NOT listening on ip 127.0.0.1, but on 0.0.0.0 so it listens on any ip and it should work.

- what happens when you ping to localhost (no responce check hosts file)
- what happen when you telnet 127.0.0.1 25 (if that's not working localhost doesn't work either)
- what happens if you telnet to servername 25?
Yes. Thats correct. You dont have telnet service listening on port 23. Anyway can you disable your firewall n AV for testing purposes..and check telnet on port 25.??
Another thing comes to my mind, how about the configuration of SMTP service...Did you enable any Ip restrictions..??
Avatar of lilyyan

ASKER

Hi, thanks for all your replies.

when i ping localhost: it shows:

Pinging PC35567 [127.0.0.1] with 32 bytes of data:

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

when i telnet localhost 25 or telnet 127.0.0.1 25 ( turned off firewall. but i can't trun off AV. it seems that i don't have permission )

nothing shown up. and the dos screen just back to the my home directory. looks like i typed cd ..

but when i telnet somedomain.edu ( if i have an account on the domain), then the telnet service can work.

many thanks ;)



Yeah...okie..just one question...You mentioned your DOS screen just back to ur home directory..just wanted to know..when you do a telnet localhost 25, did you get to see any thing on the screen ..even like "unable to telnet on localhost port 25"..or it just returns back to the dos prompt after a while..
if its the second case,then it might be your dos prompt not displaying any info, or your SMTP server not passing anything (normally you will get to see some infor like ..mssmtp svc ...blah blah....there if u type the normal smtp commands it will accept..you can try HELO...)
Avatar of lilyyan

ASKER

hello,

when i type telnet localhost, it shows:

Connecting To localhost...Could not open connection to the host, on port 23: Connect failed

when i type telnet localhost 25, it shows :
c:\

lots of thanks ;)
Hmm...okie..first part..You cant telnet to your localhost as there is no Telnet service running..so you will get the same reply"connect failed"..
Second as SMTP service running you should get some responce when you do telnet localhost 25. Not C:\..It seems some config issue i guess...Have u configured your smtp service/server as per MS...Its pretty simple infact...just few steps...When you open IISadmin you must see the SMTP service instance started n running..i guess its something like "Default SMTP Virtual Server"..you check it properties...
what else could be blocking port 25? i have uninstalled antivirus taken off everything that i think could be blocking that port and i'm still being blocked