Issue to telnet

HuaMin Chen
HuaMin Chen used Ask the Experts™
on
Hi,
Port 25 is open but I've got the following. Any advice?
C:\Users\Administrator>telnet localhost 25
Connecting To localhost...Could not open connection to the host, on port 25: Connect failed
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
That could be a lot of things. With so little information there is hart to day anything but anyway here are some tips.


1. The server where you are trying Telneting doesn't have the service started which is listening on that port. Use netstat to find if there are some ips already connected to that port.

netstat | find "8181"

2. Either on the Source or destination local firewall is blocking connection.

3. Because you mention that there is between the servers a FW I assume that one of them is in some sort DMZ. What could be the issue here is then routing, The DMZ server (server from where you Telneting) has missing routing and doesn't know how to route the traffic. To list existing routing on you server type in cmd route print(assuming that are Windows servers). and check what gateway is used to route traffic to the clan your destination server sits. Work closely with you Network tram to set proper routes on the box

4. Install Wireshark in one of the server. Do a telnet and review what the blockage are.


It's very hard for me to give you more tips as I would need more info like:

What are the source and destination servers?
What is the application which should listen on port 25?
Are you trying to connect from DMZ to Lan. Is one of the servers not joined to the domain or are both joined?

Commented:
what is the complete scenario- do you have firewall ... what is the setup describe in detail

thanks
HuaMin ChenProblem resolver

Author

Commented:
Krzysztof Kubiak,
Sorry to that, there is no details like
3l.png
Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.

Commented:
Please use another Laptop on the same network and try to telnet the port that will give an Idea if there is a problem with the local pc or the network and start troubleshooting.
HuaMin ChenProblem resolver

Author

Commented:
I did the telnet within the server.

Commented:
It's definitely not installed correctly yet. Or your SMTP service is configured to deny local connections.
HuaMin ChenProblem resolver

Author

Commented:
What to adjust/correct in firewall?

My ISP is not blocking port 25. What command to diagnose this to show nothing is being blocked on port 25?
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
netstat -an | find "25"

As i mentioned before and Kimputer is also saying. Potentially your SMTP service is not running on the server.

Telnet from a different machine, use wireshark. Is it Exchang we are talking about?
Can we give us more details what it is

This is what you should see if you telnet to a SMTP server

220 server nameMicrosoft ESMTP MAIL Service ready at Wed, 23 Oct 2019 10:19:43 +0100.

If its failing and both devices are on sam lan withour FW, then there is no FW issue but the service isnot up correctly
HuaMin ChenProblem resolver

Author

Commented:
It is using hMailserver.

See details below
3n.png

Commented:
Output didn't capture all, please try again with:

netstat -an | find ":25 "
David FavorFractional CTO
Distinguished Expert 2018

Commented:
As Krzysztof + Kimputer suggested post the output from...

netstat -an | find ":25 "

Open in new window


Be sure to notice the trailing " " after the :25. Using this exact syntax (cut + paste) will show the only port 25 listener (there can be only one).

If there's no entry for port 25 then likely your MTA is running on a different machine.

You might also check for port 465 + port 587 for completeness.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
It doesn't show TCP port 25, so likely there is no started  smtp service.
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
Hi HuaMin. You are not really giving us much details to work with. What Mail Server is it running.? Is there something in the Services. Also if you are sure this is the correct server then use Wireshark to record traffic and reproduce issue. But don't use Telnet from same server but different which suppose to have access.

What I expect to see that the connection will be just killed as there is no service using that port. Are you sure your Smtp server is. otnusing something like 465. You need to go more into details now with the app.  What happens if you try telnet localhost 25?

You can also use Powershell on you laptop and the command send-mailmeesage to sent a test email. Google send-mailmeesage to see how that works.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
noci is correct. If I squint carefully I see a trailing " " appended to the 25, so the single TCP entry (all others are UDP) shows nothing listening on port 25, so you must start a server listening on port 25 before you can connect to port 25.
HuaMin ChenProblem resolver

Author

Commented:
I don't get the details on ports 25, 587, 465. I don't know why suddenly the following issue comes out (before there was no such issue).

3o.png
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Is the mysql server runnng?   it uses TCP/IP port 3306 by default.
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
Ok. Thats a bit differen now. At least we know what the mail Server is. I read a bit the documantation and I see that you can use Windows SQL, MySQL, and PostgreeSQL.
From the port I can guess that you are using MySQ. in that case check if the Service under service is running or look for example here:
C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin

At thsistage its very hard to tell you how to troubleshoot as i wouldn't know how your SQL is installed. If its not a Windows Service then you cna install it.

A example is here:
If MYSQL service is not present in windows service then follow below setups.

a. Open cmd as administrator.

b. cd to C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin

c. Run the command: C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin>mysqld.exe --install

d. Check the MySql in the windows service, And if it is not running, Start it by clicking on the service.

e. If your using XAMMP . Start MySQL at the XAMMP control Panel.

is there anything specifig you control your SQL instance

Commented:
Also, check MySQL log files, they usually are clear why the service isn't running. As long as it's not running, the mail server just won't start.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
Unsure how this question transitioned from SMTP to MySQL.

Best to open another question related to MySQL.

The answer to this question is, there must be a port 25 listener for telnet to be able to connect to port 25.

This is the same for port 3306 (MySQL).

There must always be a listener running before connections can be handled.
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
I agree with David. The answer is that your mail see isn't running proper do of SQL connection issues. Can you troubleshoot a bit an open new question. You were given several troubleshooting steps to try.
HuaMin ChenProblem resolver

Author

Commented:
Sorry to that the current setup of Mysql should be incomplete. Where is the exact procedure to ensure I have the complete setup of Mysql?
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Follow the install/setup instructions for mysql for your platform, then create databases etc. for your SMTP server ... should be in it's instructions.
HuaMin ChenProblem resolver

Author

Commented:
I do not know what is missing to my current Mysql setup?
How to ensure proper setup of Mysql in Win 2012 server?
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Follow the install/setup instructions for mysql for your platform
So read them again and check if those steps have been taken.....  add all missing bits. We cannot advise on WHAT to do without YOU following the path taken before and compare differences  (aka identify the deficiencies).

Commented:
Please note, hMailserver, DOES NOT require MySQL. It's only overhead for the easy to understand program, that actually DEFAULTS to using its own internal programming. Without MySQL, it works just fine. Please reinstall, and make sure you DO NO select it. Probably only the super nerds who understand totally everything wants it enabled. No offense, that's not you.
Heck, it's not even my, I never saw the need to use it, as the default install works perfectly.
HuaMin ChenProblem resolver

Author

Commented:
hMailserver could not work without database, like MS Sql, Mysql, and etc.
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
Hello Komputer. You are right that hmailserver doesn't need MySQL as it has its own lite version version of MSSQL. But we are following just the error messages provided to us.

The error message was saying  "Can't connect to MYSQL server" so it is not a suggestion done by Nerds. It looks to be something that has been already configure but doesn't work.

For me the question needs to be closed as the problem was that telnen on port 25 doesn't work.

The solution is that the mail server is not proper configured and services are not started.

@HuaMon Chen: please close the question and open a new if you are having problems with Gmail server do it will go to correct group of people who have experience with that server.
HuaMin ChenProblem resolver

Author

Commented:
I have other server (having also hMailserver) working fine with SQL server.
How to resolve current issue on current server?
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
And with the working server is telnet working fine?
HuaMin ChenProblem resolver

Author

Commented:
Yes, everything is fine on the other server, including Telnet.

Commented:
You didn't follow any suggestions in this thread. So since you asked the same question, here's still the same suggestion you didn't follow yet:

Also, check MySQL log files, they usually are clear why the service isn't running. As long as it's not running, the mail server just won't start.
HuaMin ChenProblem resolver

Author

Commented:
There should be incomplete setup of Mysql on the server. How to ensure I can set up Mysql thoroughly on the server?

Commented:
If it's incomplete, you probably didn't use it yet. Just set it up from the start, because then you have everything in control (including root password etc).
https://dev.mysql.com/downloads/mysql/
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
Ok. So if it's working then your question has been answered. The reason why you can't Telnet on the not working server is because your setup Is not completed and not configured correctly.

So the service isn't running.

This is your answer you asked for and it has been resolved.

No one here can tell you how to setup your mail environment as no one knows anything about you environment.

Please In this case close the question as the original question why you can't Telnet on port 25 is answered.

If you need help with hmailserver then open a new threads but in my opinion you should look at the option to reconfigure everything from start or just use the working server as your mail server.
HuaMin ChenProblem resolver

Author

Commented:
Kimputer,
Do you have procedure to set up mysql-8.0.18-winx64?

Commented:
The setup guides you trough the whole process actually. There aren't extra requirements, other than following the setup process.
HuaMin ChenProblem resolver

Author

Commented:
You can check the whole Zip file. I do not see installer inside it.
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
Check that YT video how the guy setup his hmailserver

https://youtu.be/kxcYVL25erA

And here a full video how someone configured hmailserver with MySQL

https://youtu.be/xz1nBf34Jhw

Because you dont seem to understand how SQL work I would suggest to go with first option if it's a small environment.

Commented:
Installer was a big button there, but you apparently still missed it:
https://dev.mysql.com/downloads/windows/installer/8.0.html
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
Can a administrator close the question? Technically the question has been answered and help provided as much we can?
HuaMin ChenProblem resolver

Author

Commented:
I still have issue to see no problem with telnet.
nociSoftware Engineer
Distinguished Expert 2018

Commented:
Telnet into a non running service is solved.... ie. it will work to start the service.
IF the service won't start because there is something else wrong ... this is not a telnet problem....

"Car analogy warning:.."
You motor won't run: ... cause: the tank is empty... resolution: so fill the tank.

If you are NOT standing next to a gas station, you still need to get the gas...  
(how to get the gas is a different problem, which might be about how to refine crude oil into gas etc. ).

so if your hmailserver starts the telnet problem has gone away...
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
Ok this would be the last comment from me about this as i even don't know if you even followed the previous suggestion on it.

First check if hmailserver service is running on the server. If its not try to start it. If it doesn't start follow the steps below.

I installed few minutes ago hmail server using the hmailserver database.

Just to have the application running you can choose when installing the server to use the hmailserver database. Afterwards with your DBA team you can always us the hmailserver database setup to connect to are more appropriate database in your company

Uninstall whatever you have on the server but keep in mind that i'm not taking any responsibility for any damage caused while uninstalling the product.
It is you who need to know if it's ok to I uninstall it and start from scratch as nobody k iws your environment.

See attached what I did. If you are not too sure how to follow it please open a new thread to help you with hmailserver installation.
HuaMin ChenProblem resolver

Author

Commented:
MySQL80 service is running but I'm having issue to conect to it, in hMailserver and here is error in hMailserver:

4e.png

Commented:
This question should indeed be closed. It's really an hMailServer, combined with MySQL problem, not a telnet problem.
Anyway, the MySQL instance still need to be check for errors, and connection options. After that, it's still needed to be checked for access rights (correct MySQL user/pass, allowed to connect to 127.0.0.1, that that hMail DB, if it even exist)

Better use a third party tool to check if you can connect and access the DB in question (HeidiSQL)
HuaMin ChenProblem resolver

Author

Commented:
Where is the correct download of MySQL 5?
Commented:
MySQL Community Downloads: MySQL Installer 5.7.28:
https://dev.mysql.com/downloads/windows/installer/5.7.html
Krzysztof KubiakSenior Windows Server Intel Administrator

Commented:
Seriously?. Is that the the only accepted solution?. And you are sure that others didn't wen't beyond answering your question and don't deserve to at least be marked as helpful solution?

You want to tell me that the answer for your original Question:
Port 25 is open but I've got the following. Any advice?

Is not that your service is not running, but the URL to MySQL?

If that's the case then well. Good Luck with your installation and close the case please.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial