How do I remove the restriction on port 25 from my Amazon EC2 instance?

Last updated: 2020-09-21

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?

Resolution

Amazon EC2 restricts outbound 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. An A record, or an address record, is a DNS record that links a hostname to an IP address. An A record allows you to access your EC2 instance using a domain name instead of an IP address. Any domain or subdomain that you own could be set up as an A record for your IP address.

  • 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:

  1. Sign in with your AWS account, and open the Request to remove email sending limitations form.
  2. In the Use case description field, provide a description of your use case.
  3. (Optional) Provide the AWS-owned Elastic IP addresses that you use to send outbound emails as well as any reverse DNS (rDNS) records that AWS needs to associate with the Elastic IP addresses. If you use an EC2 instance as a mail server, it's a best practice to set up an rDNS record to help prevent outbound emails from being flagged as spam.
  4. Choose Submit.

Note: Creating a DNS A record and providing the Elastic IP addresses are optional for Amazon Simple Email Service (Amazon SES) users.

You'll receive an email with the Request ID after submitting the request form. It might take up to 48 hours to process your request. If your request is approved, you'll receive another email to notify you that the port 25 restriction on your EC2 instances is removed. If you don't receive an update within 48 hours after submitting the request, you can reply to the initial email that you received.


Did this article help you?


Do you need billing or technical support?