question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SMTP check not working with TCP

See original GitHub issue

Getting the following response on a SMTP port check (587 as well as 465)

connect EHOSTUNREACH xx.xx.xx.xx:587

The IP listed in the error above is my IP for my server.

(node:19) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 142.251.2.109:587
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1148:16)
(node:19) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 62)

I checked that IP in the log, and it looks like it belongs to google? It is not the IP of any of my servers.

https://www.whois.com/whois/142.251.2.109

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
0mnicommented, Jul 12, 2021

Is it possible that your ISP is blocking something? Testing on my end from two different servers, it works as expected as well.

If it’s a server in a lab on your own network and you’re trying to access it through your own external IP, you router could be blocking hairpinning requests. https://en.wikipedia.org/wiki/Hairpinning

It’s running on a VPS, have it working with other services going to the same host with no issues.

0reactions
0mnicommented, Jul 12, 2021

Seems like the host is doing something “funky” … Put in a ticket. Thanks all!

|18:38:09|root@status2:[/opt/uptime-kuma]> traceroute mail.danlee.ca
traceroute to mail.danlee.ca (192.210.243.56), 30 hops max, 60 byte packets
 1  ionica.meet-your-dream.live (185.232.15.122)  0.063 ms  0.038 ms  0.035 ms
 2  23.147.224.21 (23.147.224.21)  0.210 ms  0.273 ms  0.239 ms
 3  border1.ae4.dedipath-lacp.lax014.pnap.net (69.88.129.105)  0.374 ms  0.360 ms  0.310 ms
 4  core1.po1-40g-bbnet1.lax012.pnap.net (216.52.255.14)  1.371 ms core1.po2-40g-bbnet2.lax012.pnap.net (216.52.255.73)  1.600 ms  1.605 ms
 5  e0-11.cr1.lax2.us.unitasglobal.net (198.232.115.137)  1.559 ms  2.127 ms  1.756 ms
 6  ip4.gtt.net (209.120.155.53)  0.804 ms  0.847 ms  0.806 ms
 7  ae3.cr1-buf1.ip4.gtt.net (89.149.185.197)  56.253 ms be2930.ccr21.elp01.atlas.cogentco.com (154.54.42.78)  21.336 ms ae3.cr1-buf1.ip4.gtt.net (89.149.185.197)  56.689 ms
 8  78.152.61.29 (78.152.61.29)  63.353 ms 78.152.57.87 (78.152.57.87)  62.554 ms 78.152.61.29 (78.152.61.29)  63.275 ms
 9  * * *
10  * * *
11  * * *
12  mail.danlee.ca (192.210.243.56)  62.724 ms  62.736 ms  62.810 ms
|18:38:33|root@status2:[/opt/uptime-kuma]> telnet mail.danlee.ca 587
Trying 192.210.243.56...
telnet: Unable to connect to remote host: No route to host
|18:38:38|root@status2:[/opt/uptime-kuma]> telnet mail.danlee.ca 80
Trying 192.210.243.56...
Connected to mail.danlee.ca.
Escape character is '^]'.
^]
HTTP/1.1 400 Bad Request
Server: nginx
Date: Mon, 12 Jul 2021 22:38:55 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 150
Connection: close
X-Frame-Options: SAMEORIGIN

<html>
<head><title>400 Bad Request</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx</center>
</body>
</html>
Connection closed by foreign host.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot SMTP connectivity or timeout issues with ... - AWS
Troubleshoot the application's TCP connection · 1. Run the following telnet, netcat (nc), or Test-NetConnection commands. · 2. Note the output. · 3 ......
Read more >
How to Check if SMTP Port 587 is Not Blocked - Hostinger
Having issues with your SMTP connection? In this guide, you'll learn how to check whether your SMTP port 587 is blocked.
Read more >
How to test connectivity between a workstation and the SMTP ...
In some cases it may be necessary to troubleshoot SMTP server connectivity from a workstation. A simple way to test this connection is...
Read more >
Troubleshooting SMTP Connectivity from External Senders
In this article we're going to look at troubleshooting email delivery problems from external senders, focusing on SMTP connectivity.
Read more >
Determining problems with e-mail - IBM
To identify likely sources of Simple Mail Transfer Protocol (SMTP) problems, follow these steps: Verify that TCP/IP is configured for e-mail.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found