20

I'm new to Amazon Web Services (AWS) and AWS Simple Email Service (SES).

Does AWS SES allow an app to receive emails? I could not find a reference in SES developer guide.

My app requires that received emails for a customer be identified per customer and eventually they will be stored on a database (programatically). Every customer will have an email on the domain hosting the app.

For example say the app is hosted on www.example.com on AWS. Then customers of this myapp can have emails like: john@example.com, barry@example.com, lisa@example.com like that.

If this is not possible in AWS SES, please suggest on alternatives (for high volume emailing) on how this can be done in AWS environment?

Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
java_pill
  • 315
  • 1
  • 2
  • 5

5 Answers5

43

Today is your big day! AWS SES now launched Email receiving: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html

You note, that is not designed to use as personal mailbox. Current setting create perfect platform for automated receiving e-mails. Perfect for automated process of any generated reports (like a bank messages, DMARC reports, electronic invoices, etc.)

For example, here is message as was saved to S3: https://s3-eu-west-1.amazonaws.com/s3.jakub-boucek.cz/temp/lts0ahe3tucqpoii4ji0g0u3u08nrpuk1g0p3bo1 and this is output of notification delivered to my https endpoint: http://pastebin.com/yR3RjjkE

Jakub Bouček
  • 531
  • 4
  • 4
  • 1
    Excellent find, Jakub. I hadn't yet seen the announcement about this yet. – EEAA Sep 28 '15 at 22:28
  • 1
    I found it complex to setup SES. Has anyone identified a simplistic tutorial? Can Gmail be configured as a client to the service? – blong Oct 04 '16 at 17:38
  • Hi @blong yes, SES is very complex. Is unable to make Gmail (or another provider) make as "client" for this. This is not classic inbox, SES is machine processor for inbound mails. Your can use SES for redirect mails **to** Gmail. But it is not simple too. Look to [AWS Lambda SES Email Forwarder](https://github.com/arithmetric/aws-lambda-ses-forwarder) project. – Jakub Bouček Oct 18 '16 at 08:54
  • Hi @JakubBoucek , thanks for replying to my questions. It looks like I'll need to find another approach. Here's something I may consider: https://simplyian.com/2015/01/07/Hacking-GMail-to-use-custom-domains-for-free – blong Oct 18 '16 at 13:16
  • @JakubBoucek, did you find a way to extract the body "Test Message" from to the output? – limasxgoesto0 Jun 09 '17 at 03:56
  • 1
    @limasxgoesto0 Use any MIME parser, like an: https://github.com/nodemailer/mailparser – Jakub Bouček Jun 22 '17 at 08:59
  • can someone tell me , how can I store mails to s3 bucket , I am not able to store it in s3 bucket , the only thing i see is a AMAZON_SES_SETUP_NOTIFICATION file – lazarus Jun 12 '18 at 16:01
  • Is there possible now to use some POP3/IMAP client to receive mails? – Eugen Konkov Nov 14 '18 at 14:52
  • @EugenKonkov No directly by AWS SES, because is not a mailbox actually. SES is *only* service to receive or send messages. SES is does not keeping received messages, it just handle one message when is delivered and run one Rule set over that only. If you want to use POP3/IMAP backed by SES, you theoretical can build is with AWS Lambda & Dynamo DB for example, but it will not be easy. – Jakub Bouček Nov 15 '18 at 01:17
10

Amazon's SES is strictly for sending email. If you want to receive email you'd have to setup a mail transport agent (MTA) like Sendmail, Postfix, Qmail, etc on an EC2 server instance and point your DNS MX records to that instance. In which case you'd also likely need to utilize an Elastic IP (EIP) so you have a static IP. Not to mention you might end up with finding the IP address range blocked potentially by certain DNSBLs.

I tend to refrain from receiving email within AWS and have receiving mail servers outside on either dedicated co-located servers or VPSes as they tend to be cheaper and less encumbered.

Jeremy Bouse
  • 11,241
  • 2
  • 27
  • 40
  • 27
    This is no longer true. Amazon SES's new update comes with the addition of receipt rules, which enable you to store emails in a variety of different ways. – Elegant.Scripting Oct 02 '15 at 01:08
  • 2
    It is still true, https://aws.amazon.com/ses/ (read the first two lines), although SES has the capability to receive the email using receipt rules, it could not be designated as the traditional or personal mailbox. – Adnan May 05 '18 at 06:11
3

Update: After I posted this answer Amazon added support for receiving email through SES. It's designed for automated processing and not usable as a typical IMAP mailbox. See https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email.html for details.

Outdated:

Amazon SES is only for sending email.

(Source: http://aws.amazon.com/ses/)

Amazon Simple Email Service (Amazon SES) is a highly scalable and cost-effective bulk and transactional email-sending service for businesses and developers.

Receiving email is not that hard. Definitely easier than sending email, with all its anti-spam hurdles. How about setting up a Postfix server with virtual users? What kind of volume are you thinking about?

Martijn Heemels
  • 7,438
  • 6
  • 39
  • 62
  • 2
    If you downvoted, I would appreciate a comment about the reason. At the time this answer was written (4 years ago) it was certainly not wrong. – Martijn Heemels Dec 17 '15 at 00:42
  • ...you're right, the answer was not wrong at the time it was posted. But today, the information is incorrect. So a down vote is not about you, it's about the information. You might consider an edit or an update with correct info. (just a suggestion) – agentv Jan 09 '18 at 08:28
2

Amazon SES is only for sending and it never receives mail (just bounces).

You need to verify the sender's mail address to be valid. What email address this will be is up to you. You can have Freemail-Accounts, an account on your mail server on EC2, an account on your mail server in your company or whatever email account you own. But it must be yours.

mailq
  • 16,882
  • 2
  • 36
  • 66
2

The best approach I have found is to install 'dovecot' mail server locally. Tune it to listen on 127.0.0.1 and Maildir:

listen = 127.0.0.1
# mail_location = mbox:~/mail:INBOX=/var/mail/%u # Comment this and add next:
mail_location = maildir:~/Maildir

Then install s3fs

sudo apt install s3fs
sudo echo "s3fs#mailbox-konkove /home/kes/Maildir/new fuse _netdev,allow_other,profile=mail,uid=1000,gid=1000,use_cache=/tmp/S3,defaults,noatime,endpoint=eu-west-1 0 0" >> /etc/fstab

configure AWS CLI

And configure your mail client to get mails from ~/Maildir via IMAP protocol

Eugen Konkov
  • 186
  • 1
  • 2
  • 13