10

Are there any limits on the number of emails I can send from an EC2 instances when I am using a third party SMTP server to send out emails ? I use the EC2 instance to call the client's smtp server.

Thanks Santhosh

Santhosh S
  • 1,141
  • 6
  • 21
  • 43

1 Answers1

15

Yes, if you are connecting to the third-party server over TCP port 25, there is a limit imposed by the EC2 infrastructure, as an anti-spam measure.

You can request that this restriction be lifted, or, the simplest and arguably most correct solution, connect to the server on port 587 (SMTP-MSA) instead of 25 (SMTP-MTA). (The third party mail server should support it unless they really haven't been paying attention for several years.)

See http://en.m.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol

Or, using SSL would be even better.

If you aren't connecting to the 3rd party server on port 25, then there's absolutely no limit.

https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request ... is the form you can use if you want to request removal of the port 25 block, but this also requires you to establish reverse dns to take additional responsibility for the removed restriction on port 25, if you want to take that route, instead.

Michael - sqlbot
  • 169,571
  • 25
  • 353
  • 427
  • According to the EC2 FAQ there's a limitation. https://aws.amazon.com/ec2/faqs/ Q: Are there any limitations in sending email from Amazon EC2 instances? Yes. In order to maintain the quality of Amazon EC2 addresses for sending email, we enforce default limits on the amount of email that can be sent from EC2 accounts. – Sadee May 24 '18 at 19:41
  • 1
    @Sadee as mentioned above, that limit only applies to port 25. "Sending mail" refers to sending mail *directly* to the destination server, which excludes sending mail to a 3rd party server if it accepts mail on a port other than 25. Port 587 is the standard port for this. It can't be used to directly contact mail exchangers on the Internet, so there is no restriction on traffic bound for that port or any other. – Michael - sqlbot May 24 '18 at 21:02
  • But what about reverse dns? I'm getting emails rejected for not having reverse dns pointing to domain. Is it not necessary when using 587? – Ajay Singh Dec 10 '19 at 22:49
  • 1
    @AjaySingh the form used for relaxing the firewalling of port 25 is the same form you use to create reverse DNS records. Also, a properly configured mail server will not accept mail on port 587 except from its own authenticated users. – Michael - sqlbot Dec 11 '19 at 01:07
  • @Michael-sqlbot Got it now. Answer to question https://stackoverflow.com/questions/15796530/what-is-the-difference-between-ports-465-and-587 helped understand the need for 587. Thank you. – Ajay Singh Jan 21 '20 at 03:42