How to implement inbound email on Amazon AWS?

17,259

Solution 1

Amazon Simple Email Service just introduced incoming e-mail support:

https://aws.amazon.com/about-aws/whats-new/2015/09/amazon-ses-now-supports-inbound-email/

In addition to offering a scalable, cost-effective email-sending platform, Amazon SES can now accept your incoming emails. You can configure Amazon SES to deliver your messages to an Amazon S3 bucket, call your custom code via an AWS Lambda function, or publish notifications to Amazon SNS. You can also configure Amazon SES to drop or bounce messages you do not want to receive. If you choose to store your messages in Amazon S3, Amazon SES can encrypt your mail using AWS Key Management Service (KMS) before writing it to the bucket.

You configure all of these actions by defining receipt rules, which you set up by using the Amazon SES console or the Amazon SES API. Receipt rules enable a single message to trigger multiple actions. Your rules can be as broad or as specific as you choose because you can configure them to apply to specific email addresses or entire domains.

You can also use receipt rules to control which messages Amazon SES can accept on your behalf. Another filtering method is to set up custom IP address block lists and allow lists. If you know that you don’t want to receive mail originating from a particular IP address range, simply add it to your account's IP address block list. You can also override block lists by adding IP address ranges to your allow list, which provides fine-grained control over your inbound email traffic.

Solution 2

You'd have to set up your own server; that's the way to handle it using AWS. They don't provide anything other than their bulk email delivery service. A few links below:

http://jeffreifman.com/how-to-install-your-own-private-e-mail-server-in-the-amazon-cloud-aws/

http://cerebellumstrategies.com/2012/04/15/amazon-linux-postfix-dovecot/

Update: there is now a solution available in AWS, as referenced in the comments below.

Solution 3

Still doesn't appear to be possible on SES. I'd recommend looking at Mandrill and Sendgrid though.

http://mandrill.com/features/

https://sendgrid.com/docs/API_Reference/Webhooks/parse.html

Solution 4

Here is how to use Amazon and any virtual server to deliver email from SES to a local IMAP account. This plan is about stable operations: every step is under our control.

  1. Have SES receive emails
  2. And deliver to an S3 bucket and send notification to a SNS topic
  3. Subscribe to that notification with HTTPS protocol
  4. Use aws/aws-php-sns-message-validator and write a small PHP script to reveive notifications from SNS through HTTPS
  5. SNS only sends messaged ID-s, put those in a file
  6. Install incron on your server to start a shell script that downloads those messages from the S3 bucket by s3cmd and delivers to the local IMAP account by sendmail
  7. Use any IMAP server, I use Courier IMAP
  8. Read your messages with e.g. Rainloop webmail
  9. Use SES also for sending outgoing emails
Share:
17,259

Related videos on Youtube

Elenesski
Author by

Elenesski

I've been self employed since 1996 and am a information technology consultant with about 30 years of software and I/T experience; including Architecture, Analysis, Development, Testing and Project Management. The past 25+ years as a professional consultant. I am also an entrepreneur, currently working to start a tech company to offer small solutions for a small fee.

Updated on August 15, 2022

Comments

  • Elenesski
    Elenesski over 1 year

    I'm relatively new to AWS, but I am trying to figure out how to get AWS to receive emails. According this post How to configure email accounts like [email protected] or [email protected] on AWS SES only handles outbound email.

    What I am hoping to achieve is the ability to filter aliases. For example, if the alias is "xyz12alias", then any email sent to "[email protected]", can see the email and process the content appropriately. Which in my case will be storing it in account associated with the filter.

    Can anybody direct me to a strategy or service within AWS that would allow me to implement inbound email on Amazon AWS?

    https://postmarkapp.com/inbound appears to give me what I want, but is there anything within the AWS framework itself? Are there alternate services to postmarkapp?

    Thanks.

  • wkhatch
    wkhatch almost 9 years
    Was that available in November of 2013? Just wondering; thanks.
  • MHG
    MHG almost 9 years
    No, it wasn't. It's new to AWS this year.
  • Elenesski
    Elenesski over 8 years
    I unchecked this item as the correct answer and checked the item below as correct since it AWS can receive emails. But for 2 years, this was the correct answer.