Bobcares

‘Failed to connect socket: Connection timed out’ error – Here’s how to fix it?

by | Jan 5, 2019

Unable to send mail at the right time can even result in the loss of a major business opportunity.

Quite frustrating! we know.

And, when error messages contain technical jargons, it becomes more frustrating.

One such error is “failed to connect socket connection timed out“.

Fixing email delivery problems of our customers is one of the common tasks that we do as part of our Outsourced Technical Support Services for web hosts.

Today, we’ll discuss the top 4 reasons for this error and how we fix it.

 

Failed to connect socket: Connection timed out – What this means?

Simply put, the socket is the end point of communication.

In a normal mail delivery, the client socket connects to a listening server socket. And, communication happens once this connection is successful.

‘failed to connect socket connection timed out’ means that the connection to the mail server fails or the mail server can no longer be reached.

 

Failed to connect socket: Connection timed out – Causes and Fixes

Now let’s see the main reasons for this error and how our Support Engineers fix them.

1) Wrong SMTP host and port

Users should enter the mail server details in their email application.

For example, if they use Gmail as the email server, the SMTP host should be smtp.gmail.com.

Sometimes, a typo in the hostname or an inactive mail server can result in this error.

Similarly, the default SMTP port is 25, but some email providers use custom ports such as 587 to reduce spam.

In addition to that, some mail servers only allow emails via SSL port  465.

So, incorrect SMTP host or port entry in the SMTP settings of the email application can cause email delivery errors.

 

Solution

Firstly, out Support Engineers check the DNS connectivity of the mail server with the below command.

dig mail.domain.com

 

Further, to identify the correct SMTP port and it’s connectivity, we use the below command.

telnet mail.domain.com 25

 

Later, we check and verify that correct SMTP settings are used in the email application.

[Trouble with your emails and can’t identify where it went wrong? Don’t worry our Support Engineers can help you here.]

 

2) Server firewall restrictions

Firewalls play a crucial role in server security. These firewalls can sometimes block access to some IPs or IP ranges based on the abnormal behavior.

For example, some servers block access from the IP address, if the number of connections from that IP address exceeds the threshold value.

So, if the firewall doesn’t allow connection, users will see the error ‘failed to connect socket connection timed out’.

 

Solution

Firstly, our Support Engineers check and verify that the user’s IP address is blocked in the server firewall. We use online tools like https://whatismyipaddress.com/ to get the public IP address of the customer.

If the IP address is blocked in server firewall, we immediately remove it and restore the email connectivity. After that, we identify the reason for the firewall block and inform the customer.

Additionally, we whitelist the IP address in the server for a certain period of time, after confirming that it’s a legitimate request.

 

3) ISP port blocks

The default SMTP port is 25. But, most of the ISPs block this port to curb spam and abuse.

And, this is another common reason for the error.

 

Solution

Our Support Experts check the traceroute results from user’s PC to the mail server.

This gives an idea of network connectivity issues in any of the intermediate networks between the mail server and user PC.

If we find problems at the ISP level, we suggest customers to contact them.

Alternatively, we configure the mail server at alternate ports such as 587 to override ISP port blocks and restore email delivery.

Once the mail server is configured on the new port, we whitelist that port in the firewall to allow incoming connections.

 

4) PC firewall issues

This can happen at times.

Antivirus software or third party firewalls on the user’s PC can sometimes block connections to certain IPs, including the server IP.

As a result, it can give error while connecting to the mail server from the user’s PC.

 

Solution

To check the connectivity problems from user’s PC to mail server, we get the telnet results from the user’s PC to mail server port.

In this way, we identify if the user can connect to the SMTP port of the mail server.

If the connection fails, we suggest the customers to disable local firewall and antivirus and give a try.

[Need help solving your ongoing email problems? Click here to get a Support Expert to look in your issue.]

 

Conclusion

In short, ‘failed to connect socket connection timed out error’ can occur due to wrong SMTP host or port settings, ISP firewall blocks and more. Today, we’ve discussed the top 4 reasons for this error and how our Support Engineers fix them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

1 Comment

  1. Ekansh Jain

    Thanks for your help

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF