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
Related
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.
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.
I have an application that is hosted on a GCP machine.
This application is supposed to send a mail via AWS SES service.
From what I've seen in GCP documentation, all default SMTP ports are blocked in GCP machines.
is it possible to unblock one of the ports or use another port for sending the mail?
Thank you,
Maya
Use 2587 port instead of 587. http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-connect.html#smtp-connect-starttls
Look amazon SES on Google Cloud Computing instance VM using postfix
Port 2525 is unblocked and all major vendors provide support for the 2525 smtp port.
Im trying to setup a postfix SMTP mail server on my amazon ec2 instance. i followed this guide http://cybart.com/how-to-install-and-configure-postfix-on-amazon-ec2/ and many other ones on configuring the main.cf
everytime i try to telnet my mail server mail.domain.com smtp it trys to connect to address XXX.XXX.XXX.XX but then operation is timed out and im unable to connect to remote host.
If you're still looking for guidance on how to setup an email server using Amazon EC2, I've written a guide for it. Even though some find using ec2 for email to be a hassle it doesn't have to be for you.
https://avix.co/blog/server-hosting
Here are some details about what the configuration will give you;
The system uses:
-Postfix as the smtp agent
-Dovecot as the client-side connect and mailbox manager
-Postgresql database to handle mail users, mail transports and the Spamassassin database
-Amavis (w/ Clamav & Spamassassin) for protection against viruses sent through email, and to facilitate an adaptive spam detection system that learns and corrects its behavior for each individual user
-Spamassassin as the spam filter and bayes to learn spam from ham and ham from spam
-Apache as the web setup, enables http & https connections to your site
-Squirrelmail as the default webmail. After the server is setup you will be able to check your email on yourdomain.com/mail from any browser on any device
The system supports:
-Multiple transports for different domain
Good luck, and let me know if I can clarify anything.
I want to be able to send emails from my applications deployed on VCAP to email providers supporting SMTP. Is there a way to configure VCAP to make this happen?
There's no restriction on outbound communication from Cloud Foundry, you should be able to connect from your applications to any mail service you like.