How to implement inbound email on Amazon AWS?
Asked Answered
P

5

14

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.

Porringer answered 25/11, 2013 at 22:47 Comment(0)
A
10

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.

Asymptotic answered 29/9, 2015 at 11:38 Comment(0)
C
5

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.

Cogitable answered 25/11, 2013 at 22:52 Comment(3)
Was that available in November of 2013? Just wondering; thanks.Cogitable
No, it wasn't. It's new to AWS this year.Bespoke
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.Porringer
L
2

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

Larainelarboard answered 1/5, 2014 at 15:52 Comment(0)
H
2

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
Holter answered 17/7, 2017 at 1:27 Comment(0)
B
0

When using AWS SES inbound mail support, main challenge is that, it fits well for programmatic tasks, but hardly human readable since it receives in raw message delivered format.

You you can setup a S3 bucket, SNS Topic (Which could again links to Email, SMS & etc.), Lambda to forward the inbound mail with the same format it receives to take any programmatic actions based on the content of the email.

If you want read the message in human readable format, you need to write your own code to do the formatting. For example using Serverless lambda SES forwarder includes, NodeJS code runs in Lambda to convert raw email to human readable format and forward to recipient email.

Biophysics answered 17/7, 2017 at 2:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.