I'm working with a custom-built inbound mail server that listens on port 25. My first thought was to deploy it using AWS Fargate, but I found out that Fargate doesn't support port 25 for inbound or outbound traffic. Also, AWS Lambda has the same restrictions. This leaves me considering using ECS with EC2, which I'd like to avoid since I prefer serverless solutions. Is there a more scalable method to manage inbound emails on port 25 without relying on direct EC2? Just a note: using SES isn't suitable for my needs, hence the reason for my custom server.
1 Answer
Port 25 is usually blocked on EC2, and getting that unblocked isn’t straightforward as AWS tends to restrict it for security reasons. However, using a Network Load Balancer (NLB) might be your best bet; it can handle inbound traffic on port 25 without the same restrictions as EC2 instances. You could pair that with either EC2 or Fargate for a more flexible architecture. Just keep in mind that while EC2 has limitations, the NLB does not block traffic on port 25!
I appreciate that! If NLB works with Fargate for inbound, I’ll definitely go for that option. Thanks!