DEV Community

Cover image for Running in the Cloud? Watch out for low port numbers!
Guga Cavalieri
Guga Cavalieri

Posted on

1

Running in the Cloud? Watch out for low port numbers!

Every day we see more and more applications running in the Cloud. And I bet that at least 70% of them are sending some kind of email to its users.

Most of the email providers (SendGrid, SendInBlue, SES...) support sending emails using the SMTP protocol, and they expose a bunch of ports for us to do it (25, 587, 2525).

The big problem here is that most of the cloud providers block or impose some sort of throttling on low port numbers to protect against abuse. And this can cause big problems if we are not careful.

The other day we had a big queue of emails to be processed and we started seeing some Connection Refused errors in our monitoring tool. Weirdly, some of the emails were going through while others were going back to the queue and throwing errors.

As the queue grew bigger we found out that AWS throttles outgoing traffic on port 25 and other low port numbers. It was time for us to review some of the port numbers we were using for SMTP and change it to 587, which is the recommended value by SendGrid.

So just a heads up! If you are running in the Cloud it's good to be careful with outgoing and incoming traffic on low port numbers otherwise some users might never see receive your emails or messages ;)

References:

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay