How do I remove the restriction on port 25 from my EC2 instance?
Last updated: 2020-04-08
I'm having trouble sending email over port 25 of my Amazon Elastic Compute Cloud (Amazon EC2) instance, or I'm getting frequent timeout errors. How do I remove the port 25 restriction on my EC2 instance?
Amazon EC2 restricts traffic on port 25 of all EC2 instances by default, but you can request for this restriction to be removed.
First, create a corresponding DNS A record:
- If you're using Amazon Route 53 as your DNS service, either create a new resource record set that includes an A record, or update your existing resource record set to include a new A record.
- If you're using a service other than Amazon Route 53, ask your DNS provider to create an A record for you.
Then, request AWS to remove the port 25 restriction on your instance:
- Sign in with your AWS account, and open the Request to Remove Email Sending Limitations form.
- In the Use Case Description field, provide a description of your use case.
- (Optional) Provide the AWS-owned Elastic IP addresses that you use to send outbound emails as well as any reverse DNS records that AWS needs to associate with the Elastic IP addresses. With this information, AWS can reduce the occurrences of emails sent from the Elastic IP addresses being marked as spam.
- Choose Submit.
If your request is approved, you'll receive an email to notify you that the port 25 restriction on your EC2 instances is removed.