"Connection to host lost" on telnet to port 25
12,457
As previously discussed in the comments, I am writing this answer for others who may come across this problem.
Adding a Windows Firewall rule to open port 25 will rectify this problem as the connection was rejecting the connection thus not allowing telnet to establish.
Related videos on Youtube
Author by
WhiteOne
Updated on September 18, 2022Comments
-
WhiteOne over 1 year
i installed smtp4dev to test receive mails in my localserver(xampp) for the registration form here: https://github.com/panique/php-login
note: localserver is on port: 8080
my php.ini file for SMTP section is as follows and the smtp is activated as that was shown in xampp status:
[mail function] SMTP = localhost smtp_port = 25 sendmail_from = postmaster@localhost sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t" sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe" ;mail.log = "C:\xampp\php\logs\php_mail.log"
but i didn't receive any email, so i checked the smtp if it worked via telnet:
telnet localhost 25
and i get this after running telnet command:
220 localhost smtp4dev ready Connection to host lost.
how can i solve this problem?
-
Proxy over 9 yearsIs the port open and accepting connections?
-
WhiteOne over 9 yearsport 25 status is Time_wait how can i make it listening? i think this the problem right?
-
Proxy over 9 yearsOn Windows you will have to create an firewall rule to explicity allow the port. On Linux you will have to iptables command to add the port to Accept connections. To open a port in issue: iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-
WhiteOne over 9 yearsi'm on windows, when i add firewall rule for port 25 do i need to enable it for public also or just private? i will use smtp4dev for my local host only as a test.
-
Proxy over 9 yearsThat depends solely on your network configuration and if you need public access to it. In most cases, you only need to use Private, but you can apply both to see if the problem rectifies and de-select 'public' in the rule at a later stage. Personally, I'd just Private.
-
WhiteOne over 9 yearsokay :) thanks a lot :) that solved my problem when i add a rule for port 25 in firewall settings.
-