DEV Community

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

Posted on

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:

Top comments (0)