Email continues to be a critical medium for communications between businesses and customers and remains an important channel for building automation around sending and receiving messages. Email automation enables use cases like updating a ticketing system or a forum via email, logging and auditing an email conversation, subscribing and unsubscribing from email lists via email, transferring small files via email, and updating email contents before delivery. This session implements and presents live code that covers a use case supported by Amazon.com's seller business: how to protect your customers' privacy by anonymizing email for third-party business-to-business communication on your platform. With Amazon SES and the help of Amazon S3, AWS Lambda, and Amazon DynamoDB, we cover architecture, walk through code as we build an application live, and present a demonstration of the final implementation.
2. The State and Scale of Email
- Email is not dead
- The Internet sends and receives 2 million emails per
second
3. The State and Scale of Email
- Classic email architectures require
- Postmasters
- Deliverability managers
- System administrators
- Engineers
A typical 1000-user organization will spend upwards of
$1.8 million a year just on managing spam
Source: Radicati Group
4. Postmasters
- Responsible for keeping inboxes clear of spam
- Configure DNS-based sender reputation systems
- Process complaints to identify false negatives
- Analyze senders to identify spammers and botnets
- Maintain sender reputation metrics
5. Postmasters
- Responsible for keeping inboxes clear of spam
- Configure DNS-based sender reputation systems
- Process complaints to identify false negatives
- Analyze senders to identify spammers and botnets
- Maintain sender reputation metrics
6. Deliverability Managers
- Ensure that marketing campaigns reach widest audience
possible
- Target campaigns based on user preferences
- Maintain high sender reputation
- Enforce compliance with email security standards
- Sender Policy Framework (SPF)
- DomainKeys Identified Mail (DKIM)
7. Deliverability Managers
- Ensure that marketing campaigns reach widest audience
possible
- Target campaigns based on user preferences
- Maintain high sender reputation
- Enforce compliance with email security standards
- Sender Policy Framework (SPF)
- DomainKeys Identified Mail (DKIM)
8. System Administrators and Developers
- Ensure that your email infrastructure runs smoothly
- Email firewall devices
- Security appliances
- Mailbox servers
- Build and manage applications
- Campaign management
- Customer support
- Archival
9. The State and Scale of Email
- Every business must navigate the email landscape to
communicate with customers
- Maintaining your position in the ecosystem as a sender
and receiver is critical
16. Receiving Mail with Amazon SES
- Launched September 2015
- Postmaster as a service
- Easy programmatic access to receiving email
- Integrates with Amazon S3, AWS KMS, Amazon SNS,
Amazon WorkMail, and AWS Lambda
23. Amazon SES Receipt Rules
Internet Amazon SES
*@amzn.co
Amazon
WorkMail
support@amzn.co
Customer Support
24. Amazon SES Receipt Filters
Internet Amazon SES
54.240.12.34
Inbox
173.194.33.150
Reject
✗
25. Amazon SES
- Works with postmasters and deliverability managers of
major email service providers
- Provides powerful tools for postmasters, deliverability
managers, systems administrators, and developers
- Makes email accessible for businesses
28. Building Email Applications
Use AWS to solve email-related business problems
Leverage the following services:
AWS LambdaAmazon SES Amazon
DynamoDB
and more…
29. Example Solutions Leveraging SES & AWS
• Automatically create support tickets from customer
email.
• Implement an email auto-responder.
• Process email bounces and complaints.
• Create an email archival solution.
• Receive files from customers via email.
35. Anonymous Email — Requirements
• Protect customer information
• Utilize email standards
• Secure and resilient to abuse
• Fault tolerant
• Provide auditing and history
42. Anonymous Email — Improvements
• Disable communication after elapsed time
• Store transaction logs
• Emit metrics
• Time until response
• Unanswered emails
43. Anonymous Email — Savings
Customers using SES for this solution can expect to gain:
• Over 50% cost savings compared to EC2-based solution
• Reduction in operations and maintenance
• Effortless scaling from 100/day to 100MM/day
$150-$600/month
for multi-AZ EC2
instances & load balancer
$50/month
for 500,000 messages
with SES
46. • Header in email messages, usually marketing
• Supported by email clients & providers (gmail, hotmail, etc.)
From: josh@example.com
Subject: Monthly newsletter
Date: August 31, 2015 3:13:02 PM PDT
To: jasmine@example.com
List-Unsubscribe: <mailto:z8dfmiy1jd6ks9a@unsubscribe.example.com>
List Unsubscribe — The Solution
47. List Unsubscribe — Requirements
• Add List-Unsubscribe header to outgoing emails
• Accept email unsubscribe requests
• Manage subscriber preferences
• Secure and resilient to abuse
• Fault tolerant
48. • Unique identifier encapsulates customer ID or email
address
• Could optionally contain mailing or campaign ID for
detailed unsubscribe metrics
• HTTP URLs are also welcome
List Unsubscribe — Add header
From: josh@example.com
Subject: Monthly newsletter
Date: August 31, 2015 3:13:02 PM PDT
To: jasmine@example.com
List-Unsubscribe: <mailto:z8dfmiy1j4d9a@unsubscribe.ses-example.com>
49. List Unsubscribe — SES Receipt Rule
AWS Lambda
Amazon SES
Unsubscribe
request
Lambda SES event object contains
information about the message received
SES receipt
rule
50. List Unsubscribe — Example SES Event
"ses": {
"mail": {
"commonHeaders": {
"from": ["Morgan Thomas <morgan@example.com>"],
"to": ["Bobby <bobby@example.com>"],
"returnPath": "morgan@example.com",
"messageId": "j4ghdrd4gmvo00",
"date": "Thu, 10 Sep 2015 17:25:37 +0000",
"subject": "Monthly newsletter"
},
"headers": […],
"messageId": "f18rgld2sbme6gjpuhncr2gmlo00"
},
"receipt": {
"spamVerdict": { "status": ”FAIL” },
"virusVerdict": { "status": ”PASS” },
"dkimVerdict": { "status": "PASS” },
"spfVerdict": { "status": "PASS” },
"processingTimeMillis": 409
}
Commonly used headers
Complete list of headers
SES message ID
Information provided by
SES about the email
51. List Unsubscribe — AWS Lambda Application
AWS Lambda
Amazon SES
Parse
recipient
Look up email
address
Unsubscribe
DynamoDB
table
DynamoDB
table
Filter abuse
Unsubscribe request
54. What’s in Common? — Abuse Filtering
• You don’t want spam
• You don’t want viruses
Optionally:
• You only want authenticated mail
• (valid SPF & DKIM)
• You only want mail for valid recipients
• (existing users in directory)
55. Active Rule Set
S3 action Lambda action
Lambda action
Amazon SES
List unsubscribe
Anonymous email
Abuse filter
mail.ses-example.com
unsubscribe.ses-example.com
1
2
3
(applies to all recipients)
56. Active Rule Set
S3 action Lambda action
Lambda action
Amazon SES
List unsubscribe
Anonymous email
Abuse filter
mail.ses-example.com
unsubscribe.ses-example.com
1
2
3
Lambda action Bounce action Stop action
Determine if
mail is desired
(is it spam?)
If desired
return
‘stop_rule’
If not desired
return
‘continue’
RequestResponse (synchronous)
57. Active Rule Set
S3 action Lambda action
Lambda action
Amazon SES
List unsubscribe
Anonymous email
mail.ses-example.com
unsubscribe.ses-example.com
1
2
3
Abuse filter
Lambda action Bounce action Stop actionS3 action
58. Active Rule Set
S3 action Lambda action
Lambda action
Amazon SES
List unsubscribe
Anonymous email
mail.ses-example.com
unsubscribe.ses-example.com
1
2
3
Abuse filter
Lambda action Bounce action Stop actionS3 action
59. Your Future Rule Set
Amazon SES
????
• Share ideas and feature requests on the AWS forums
• forums.aws.amazon.com
• Follow announcements and email tips on the SES blog
• sesblog.amazon.com