AWS EC2 email sending limit when using third party smtp server - amazon-web-services

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

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.

Related

telnet timing out from aws ec2 to sendgrid

I am trying to configure listmonk with AWS EC2 and sendgrid. However I'm getting timeout while sending mails. I tried debugging using the documentation and when I try to telnet, I'm getting timeout:
# Command
telnet smtp.sendgrid.net 25
I checked the outbound settings and everything is whitlisted:
Is there anything else I need to do to telnet to smtp.sendgrid.net?
By default, AWS blocks outbound traffic on port 25, and you have to file a request to get the restriction removed.
I usually just use a different SMTP port instead of trying to get port 25 opened. SendGrid's documentation states:
SendGrid accepts unencrypted and TLS connections on ports 25, 587, &
2525. You can also connect via SSL on port 465. Many hosting providers and ISPs block port 25 as a default practice. If your Telent session
continually times out or will not connect using port 25, it is likely
that your ISP or hosting provider is blocking the port. You can
contact your host/ISP to find out which ports are open for outgoing
SMTP relay. We recommend using port 587 to avoid any rate limiting
that your server host may apply.
I suggest just switching to use port 587

AWS SES - SMTP vs SES client

While working with AWS SES, I think I have two choices to send mail. Java is the programming language I use:
Use Amazon SES client library
Send mail using SMTP (maybe using Java mail API).
But I guess Amazon SES client library is not using SMTP - I guess it is using HTTPS for the communication from my machine to the mail server.
Or is it another layer built on top Java SMTP library for easier configuration?
I am asking this because I could not configure SMTP port etc when I am using Option #1 above.
Can you please help me understand the difference? Thanks in advance.
You are correct, you have both options to send email.
Option 1 uses SES API, which is available via HTTPS. So it is not related to SMTP protocol.
You have the same capabilities, but instead of use SMTP protocol you will be using SES API.
As it is an AWS API you will need to provide credential to use it.
Java example:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-sdk-java.html
The Amazon SES SMTP endpoint requires that all connections be encrypted using Transport Layer Security (TLS).
Regarding option 2, it is mandatory to use TLS, so each type of TLS option has its own available ports.
Ports for STARTTLS: 25, 587, or 2587
Ports for SMTPS: 465 or 2465
It is also mandatory to use authentication.
So you SMTP client must support TLS (STARTTLS or SMTPS) and authentication.
Documentation:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html
Java example using STARTTLS:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-smtp-java.html
If you run in a private network w/o Internet GW you need SMTP as there is no VPC interface endpoint for SES. There is a feature request open w/ AWS but no ETA

Port 25 is blocked on AWS

I am completely new in AWS and I want to know about port 25 to send SMTP mail.
My organisation is using one SMTP relay server which is having only one port 25, no any other port is available.
I have an application (written in flask) which i will deploy on AWS and will use it to send SMTP mail using my organisation's server to outlook.
Now, i want to know whether port 25 is blocked or not and can it be used in this scenario or not.
Thanks in advance.
This is blocked on purpose by Amazon.
If the email provider supports another port you're advised to use this, however it seems for your use case you're limited.
In this case you will need to follow the instructions that are available on the How do I remove the restriction on port 25 from my EC2 instance? page. This will require you to fill in this form specifying your business case for why it needs to be unblocked.

mail smtpport configuration in Google cloud - zimbramailcow

I have installed zimbra on GCP VM. Im able to received mail from outer and inner network but unable to send mail in outer network. I have change smtp port to 2525 and define firewall but still not able to send mail.
br//
madhur
For security reasons Google blocks SMTP traffic and that is why you can't send email:
By default, Compute Engine allows outbound connections on all ports
but port 25, which is blocked because of the risk of abuse. All other
ports are open, including ports 587 and 465.
See also the documentation what kind of traffic gets always blocked by default in GCP (and you can't change it).
The only way to semd emails from you GCP instances is to use trusted 3rd party tools such as: SendGrid, Mailgun, or Mailjet.
Have a look at the documentation on how to send emails from GCP VM's, which provider is best suited for you and how to configure specific service.

Request time out when pinging server on AWS

In order to check the health of a server I have, I want to write a function I can call in order to check whether my service is online.
I used command prompt to ping the IP address of the server, however all of the packets were lost due to request time outs.
I'm guessing I don't need to have a dedicated function related to handle being pinged, and I believe that it is due to the server security protocols denying the request. Currently the server only allows inbound traffic of HTTP requests, and I believe this to be the problem.
For an AWS instance, what protocol rule do I need to add in order to accept ping requests?
In the Security Group for the EC2 instance you should allow inbound ICMP.