AWS SMTP relay

Working with ISVs (Independent Software Vendors) in certain application we have notifications. Some of such vendors offer their personal SMTP relay, some of them ask for SMTP settings to enable email notifications around updates in their software. Of course we can always configure Gmail's SMTP, but in this article I'd love to explain how we can do this through Amazon Simple Email Service with the $0.10 per 1000 emails sent. If you are in Amazon and using it's services, this is not really big deal for couple of emails per day. You won't be changed that hard, but you'll get secured and reliable SMTP server and always get your email notifications in time.

Simple Email Service first setup

At the time of writing this post it is available in three regions: us-east-1 (N. Virginia), us-west-2 (Oregon) and eu-west-1 (Ireland). So make sure you are in your console and pick one of this region (geographically closer to you - better). Next - we need to verify either entire domain (we can send on behalf of any email from this domain) or just email. Email verification is faster and simpler (since we don't have to make any changes in our domain zones). However it is up to you if you'd like to white-list entire domain. Just follow this instruction.

If your AWS account is new, you are in sandbox environment probably. Open up support ticket with instructions on the above page and you should be good in 24 hours.

Add your email for verification and go to your inbox.

AWS SES - verify email

Once added, you should be able to see your email in the waiting list.

AWS SES - pending verification

Confirm using the following link in your email.

AWS SES - confirm verification email

So we have done:

  • Added our email into SES;
  • Confirmed that email by clicking the link in our inbox;
  • Done.

SMTP configuration

Now we need to head over to "SMTP settings" and grab server name (for me, since I use Ireland region, it is email-smtp.eu-west-1.amazonaws.com). Since AWS SES requires requires authentication for sending emails through it-self we need to create IAM user (Access Key ans Secret Key are being used as login ans password). I do encourage to use limited to SES services policy only. You can create that specific user by "Create My SMTP Credentials" and you'll get IAM user with that limited policy, but if you want to do this through IAM service use the following inline policy:


{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "ses:SendRawEmail",
            "Resource": "*"
        }
    ]
}

This is fine grained permissions tailored for the task we want to accomplish (SMTP server relay). Don't forget to save your Access and Secret keys (if you lost them, just assign new pair in IAM).

AWS SES - IAM user for SMTP relay

Application configuration

Let's take our random software and configure notifications.
I am going to setup notifications for my CloudBerry Backup (standalone). I'd like to have reports about all my plans taken in the product (backup and restore, consistency check). In order to do this, the following form should be full filled:

CloudBerry Backup - notifications setup using SMTP AWS SES

There are three ports AWS offers to use: 25, 465 and 587. Depends on product requirements and your preferences.

Sending Statistics

Let's head over to "Sending Statistics" and see what we can do and what we have rest:

AWS SES - sending statistics

Looks like we have huge reserve for our notifications. We are done. Hope it helps someone!


In short, this is about:
#aws ses
#smtp
#amazon

Start discussion:
Related articles:
122 what is possible with aws free tier preview
I made light talk on one of our recent #AWSRus community gathering in Moscow and decided to discover this topic with further series of posts in my blog covering various AWS services. ... more
about 1 month#free tier #amazon
81 mount aws s3 bucket to your el capitan preview
Learn how to mount S3 bucket to your Mac OS ... more
120 ec2 user data script example preview
Launching AWS EC2 can be supplied by something what is known as "user data" and it helps to have things ready before you access it. ... more
111 data backup and disaster recovery with aws preview
CloudAcademy webinar: how to use AWS services for Backup and DR challenges. I am presenter! ... more
118 how to send sms using amazon sns and python preview
Send text messages (SMS) with few lines of Python code using Amazon SNS and boto3 SDK. ... more
79 mount aws s3 bucket to your debian preview
In this very short tutorial we are going to mount S3 bucket from AWS to the local folder of Debian. ... more
88 amazon solutions architect associate exam preview
August, 9th, 2016 - passed my Amazon CSAA. Few tips I'd love to share here. ... more
61 amazon web services cloudfront with subdirectory preview
In this article we are going to set up CloudFront for static site. And there is nice tip how to nested content (i.e. subfolders) available. ... more
101 aws ec2 linux backup preview
Amazon Web Services (AWS) has its own AWS Linux AMI (also free tier). There are several reasons you want to use this AMI for your projects. ... more
110 awsrus russian st petersburg user group for aws preview
AWSRus — Official AWS User Group Russia (St. Petersburg). ... more
116 aws efs windows preview
AWS Elastic File System is scalable file system in the cloud, requires NFSv4.1 client and does not support Windows at the moment. However let's see what we can do.. ... more
117 seo friendly aws static website with ssl preview
It's been written many times, however there is no consistency how to make static web site with SSL and SEO friendly urls (301 redirect). Pure AWS based services static website ahead, check details inside! ... more
121 aws ec2 user data script windows preview
How to pre-deploy App using user data script for Windows OS with powershell powered script in EC2? Example inside. ... more