{"id":48822,"date":"2017-06-13T12:05:38","date_gmt":"2017-06-13T06:35:38","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=48822"},"modified":"2017-06-13T13:00:29","modified_gmt":"2017-06-13T07:30:29","slug":"setting-aws-ses-bounce-notification","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/setting-aws-ses-bounce-notification\/","title":{"rendered":"Setting AWS SES Bounce Notification"},"content":{"rendered":"<p>Amazon Simple Email Service (SES) is an email platform which provides a cost-effective way to send and receive emails using your own email addresses and domains. It is used for sending a large number of emails. However, it is equally important to handle email bounce and complaints as your account may get blocked if the percentage of bounce notification is way too high.<\/p>\n<p><span style=\"font-weight: 400;\">This blog illustrates how we can setup SES bounce notification to handle email bounce and complaints. Follow the following steps to configure the same:<\/span><\/p>\n<p><b>Step 1: Setup a configuration set<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Open AWS SES console<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Choose<strong> Configuration Sets<\/strong> from the left navigation pane, and select <strong>create configuration<\/strong> <strong>set<\/strong>.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-48823 size-full\" style=\"border: 1px solid black;\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses1.png\" alt=\"ses1\" width=\"979\" height=\"403\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses1.png 979w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses1-300x123.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses1-624x256.png 624w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"font-weight: 400;\"><strong><span style=\"font-weight: 400;\">Give the configuration set name and click on <\/span><b>Create Configuration Set.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-48824 size-full\" style=\"border: 1px solid black;\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses3.png\" alt=\"ses3\" width=\"690\" height=\"343\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses3.png 690w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses3-300x149.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses3-624x310.png 624w\" sizes=\"(max-width: 690px) 100vw, 690px\" \/><\/b><\/strong><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Now, on the configuration sets page, select the configuration set that you created in the previous step.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Go to <\/span><b>Actions<\/b><span style=\"font-weight: 400;\">, and select <\/span><b>edit<\/b><span style=\"font-weight: 400;\">.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-48825 size-full\" style=\"border: 1px solid black;\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses5.png\" alt=\"ses5\" width=\"785\" height=\"175\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses5.png 785w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses5-300x66.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses5-624x139.png 624w\" sizes=\"(max-width: 785px) 100vw, 785px\" \/><\/span><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\"><strong><span style=\"font-weight: 400;\">For <\/span><b>Add Destination<\/b><span style=\"font-weight: 400;\">, choose to <\/span><b>Select a destination type<\/b><span style=\"font-weight: 400;\"> and then select <\/span><b>Cloudwatch<\/b><span style=\"font-weight: 400;\">.<\/span><\/strong><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-48826 size-full\" style=\"border: 1px solid black;\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses6.png\" alt=\"ses6\" width=\"1062\" height=\"455\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses6.png 1062w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses6-300x128.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses6-1024x438.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses6-624x267.png 624w\" sizes=\"(max-width: 1062px) 100vw, 1062px\" \/><\/li>\n<\/ul>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Give a name for the event destination. Select <\/span><b>Bounce<\/b><span style=\"font-weight: 400;\"> and <\/span><b>Complaints<\/b><span style=\"font-weight: 400;\"> about <\/span><b>Event<\/b> <b>Types <\/b>and select<b> Enabled<\/b><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">For value source, select <\/span><b>Message-Tag<\/b><span style=\"font-weight: 400;\"> and give <\/span><b>Dimension<\/b> <b>Name<\/b><span style=\"font-weight: 400;\"> accordingly. For example, we can set a dimension name &#8220;env&#8221; to differentiate between emails coming from production or staging and select\u00a0<\/span><b>save.<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-48827 size-full\" style=\"border: 1px solid black;\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses8.png\" alt=\"ses8\" width=\"1035\" height=\"432\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses8.png 1035w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses8-300x125.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses8-1024x427.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses8-624x260.png 624w\" sizes=\"(max-width: 1035px) 100vw, 1035px\" \/><\/b><\/li>\n<\/ul>\n<p><b>Step2: Configure SES email address<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">In AWS SES console navigation console, select <\/span><b>Email<\/b> <b>Addresses<\/b><span style=\"font-weight: 400;\"> under <\/span><b>Identity<\/b> <b>Management<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select your AWS SES verified email address and select view details.<\/span><\/li>\n<li style=\"font-weight: 400;\"><strong><span style=\"font-weight: 400;\">Under <\/span><b>Notifications<\/b><span style=\"font-weight: 400;\">, choose <\/span><b>Edit<\/b> <b>Configuration<img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-48828 size-full\" style=\"border: 1px solid black;\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses9.png\" alt=\"ses9\" width=\"1070\" height=\"535\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses9.png 1070w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses9-300x150.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses9-1024x512.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2017\/05\/ses9-624x312.png 624w\" sizes=\"(max-width: 1070px) 100vw, 1070px\" \/><\/b><\/strong><\/li>\n<\/ul>\n<ul>\n<li><span style=\"font-weight: 400;\">Under <\/span><b>SNS Topic Configuration<\/b><span style=\"font-weight: 400;\">, select the SNS topic that you want to get triggered in case of email bounce.Click on\u00a0<\/span><b>Save<\/b> <b>config<\/b><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-48955 size-full\" style=\"border: 1px solid black;\" src=\"\/blog\/wp-ttn-blog\/uploads\/2017\/06\/ses-new.png\" alt=\"ses-new\" width=\"660\" height=\"589\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2017\/06\/ses-new.png 660w, \/blog\/wp-ttn-blog\/uploads\/2017\/06\/ses-new-300x267.png 300w, \/blog\/wp-ttn-blog\/uploads\/2017\/06\/ses-new-624x556.png 624w\" sizes=\"(max-width: 660px) 100vw, 660px\" \/><\/li>\n<\/ul>\n<p><b>Step 3: Send Email<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The setup is now ready. You can test the same by sending a test email from the console which should include the configuration set name as well the tag defined in the configuration set. For doing so, follow the following steps:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">In the <\/span><b>Send Test Email<\/b><span style=\"font-weight: 400;\"> dialogue box, for Email Format, choose\u00a0<\/span><b>Raw<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">For the To address, type an address from the <a href=\"http:\/\/www.tothenew.com\/blog\/configure-amazon-ses-with-exim\/\">Amazon SES<\/a> mailbox simulator, such as <\/span><b>complaint@simulator.amazonses.com or bounce@simulator.amazonses.com<\/b><span style=\"font-weight: 400;\"> and use the following template in the message text box replacing the name of the configuration set name and From address.<\/span><\/li>\n<\/ul>\n<p>[code]<br \/>\nX-SES-MESSAGE-TAGS: env=dev<br \/>\nX-SES-CONFIGURATION-SET: CONFIGURATION-SET-NAME<br \/>\nSubject: Amazon SES Event Publishing Test<br \/>\nFrom: Amazon SES User &amp;lt;FROM-ADDRESS<br \/>\nMIME-Version: 1.0<br \/>\nContent-Type: text\/plain<\/p>\n<p>This is a test message.<br \/>\n[\/code]<\/p>\n<p>If the email gets bounced, you will receive\u00a0an SNS notification on the topic that you had configured in the previous steps. You will receive a JSON with the following details:<\/p>\n<div style=\"height: 620px; width: 850px; border: 1px solid #ccc; font-size: 20px,font-family: Georgia, Garamond, Serif; overflow: auto;\">\n<p>[code]<br \/>\n{<br \/>\n\t&quot;notificationType&quot;: &quot;Bounce&quot;,<br \/>\n\t&quot;bounce&quot;: {<br \/>\n\t\t&quot;bounceType&quot;: &quot;Permanent&quot;,<br \/>\n\t\t&quot;bounceSubType&quot;: &quot;General&quot;,<br \/>\n\t\t&quot;bouncedRecipients&quot;: [<br \/>\n\t\t{<br \/>\n\t\t\t&quot;emailAddress&quot;: &quot;bounce@simulator.amazonses.com&quot;,<br \/>\n\t\t\t&quot;action&quot;: &quot;failed&quot;,<br \/>\n\t\t\t&quot;status&quot;: &quot;5.1.1&quot;,<br \/>\n\t\t\t&quot;diagnosticCode&quot;: &quot;smtp; 550 5.1.1 user unknown&quot;<br \/>\n\t\t}<br \/>\n\t\t],<br \/>\n\t\t&quot;timestamp&quot;: &quot;2017-03-28T09:08:33.821Z&quot;,<br \/>\n\t\t&quot;feedbackId&quot;: &quot;0100015b142c8554-f5e1dbb9-03f0-499d-bae4-2c127024cc14-000000&quot;,<br \/>\n\t\t&quot;remoteMtaIp&quot;: &quot;207.171.163.188&quot;,<br \/>\n\t\t&quot;reportingMTA&quot;: &quot;dsn; a10-51.smtp-out.amazonses.com&quot;<br \/>\n\t},<br \/>\n\t&quot;mail&quot;: {<br \/>\n\t\t&quot;timestamp&quot;: &quot;2017-03-28T09:08:33.000Z&quot;,<br \/>\n\t\t&quot;source&quot;: &quot;XXX@XXXX.COM&quot;,<br \/>\n\t\t&quot;sourceArn&quot;: &quot;arn:aws:ses:us-east-1:xxxxxxxxxxx:identity\/xxxx@xxxxx.com&quot;,<br \/>\n\t\t&quot;sourceIp&quot;: &quot;XXX.XXX.XX.X&quot;,<br \/>\n\t\t&quot;sendingAccountId&quot;: &quot;XXXXXXXXXX&quot;,<br \/>\n\t\t&quot;messageId&quot;: &quot;0100015b142c828e-157b22a2-7d68-43a2-96f5-2831b999a69c-000000&quot;,<br \/>\n\t\t&quot;destination&quot;: [<br \/>\n\t\t\t&quot;bounce@simulator.amazonses.com&quot;<br \/>\n\t\t],<br \/>\n\t\t&quot;headersTruncated&quot;: false,<br \/>\n\t\t&quot;headers&quot;: [<br \/>\n\t\t{<br \/>\n\t\t\t&quot;name&quot;: &quot;X-SES-MESSAGE-TAGS&quot;,<br \/>\n\t\t\t&quot;value&quot;: &quot;env=dev&quot;<br \/>\n\t\t},<br \/>\n\t\t{<br \/>\n\t\t\t&quot;name&quot;: &quot;X-SES-CONFIGURATION-SET&quot;,<br \/>\n\t\t\t&quot;value&quot;: &quot;configuration_set_name&quot;<br \/>\n\t\t},<br \/>\n\t\t{<br \/>\n\t\t\t&quot;name&quot;: &quot;Subject&quot;,<br \/>\n\t\t\t&quot;value&quot;: &quot;Amazon SES Event Publishing Test&quot;<br \/>\n\t\t},<br \/>\n\t\t{<br \/>\n\t\t\t&quot;name&quot;: &quot;From&quot;,<br \/>\n\t\t\t&quot;value&quot;: &quot;XXX@XXXX.COM&quot;<br \/>\n\t\t},<br \/>\n\t\t{<br \/>\n\t\t\t&quot;name&quot;: &quot;MIME-Version&quot;,<br \/>\n\t\t\t&quot;value&quot;: &quot;1.0&quot;<br \/>\n\t\t},<br \/>\n\t\t{<br \/>\n\t\t\t&quot;name&quot;: &quot;Content-Type&quot;,<br \/>\n\t\t\t&quot;value&quot;: &quot;text\/plain&quot;<br \/>\n\t\t}<br \/>\n\t\t],<br \/>\n\t\t&quot;commonHeaders&quot;: {<br \/>\n\t\t\t&quot;from&quot;: [<br \/>\n\t\t\t\t&quot;XXX@XXXXX.COM&quot;<br \/>\n\t\t\t],<br \/>\n\t\t&quot;subject&quot;: &quot;Amazon SES Event Publishing Test&quot;<br \/>\n\t\t}<br \/>\n\t}<br \/>\n}<br \/>\n[\/code]<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>For further handling, you can also trigger a lambda function by extracting the value from JSON and process the same according to your use case.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Amazon Simple Email Service (SES) is an email platform which provides a cost-effective way to send and receive emails using your own email addresses and domains. It is used for sending a large number of emails. However, it is equally important to handle email bounce and complaints as your account may get blocked if the [&hellip;]<\/p>\n","protected":false},"author":914,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"image","meta":{"iawp_total_views":25},"categories":[1174,2348],"tags":[248,1700,3450,596,49],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/48822"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/914"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=48822"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/48822\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=48822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=48822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=48822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}