# לתקן עיקול SNS ב-AWS

**URL:** https://meta.discourse.org/t/fix-aws-sns-bounce/303015
**Category:** Marketplace
**Created:** [9 באפריל,‏ 2024,‏ 11:22am UTC](https://meta.discourse.org/t/fix-aws-sns-bounce/303015 "2024-04-09T11:22:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Mr.X\_Mr.X](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mr.x_mr.x/32/126610_2.png) [@Mr.X\_Mr.X](https://meta.discourse.org/u/Mr.X_Mr.X)
#### Post date: [9 באפריל,‏ 2024,‏ 11:22am UTC](https://meta.discourse.org/t/fix-aws-sns-bounce/303015/1 "2024-04-09T11:22:37Z")

</div>

What would you like done?

Method to make AWS SNS Bounce work on instances.

When do you need it done?

ASAP

What is your budget, in $ USD that you can offer for this task?

200$

---

<div class="post-metadata">

### Author: ![Mr.X\_Mr.X](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mr.x_mr.x/32/126610_2.png) [@Mr.X\_Mr.X](https://meta.discourse.org/u/Mr.X_Mr.X)
#### Post date: [9 באפריל,‏ 2024,‏ 11:23am UTC](https://meta.discourse.org/t/fix-aws-sns-bounce/303015/2 "2024-04-09T11:23:23Z")

</div>

I get stuck at Step 12

> [@Configuring AWS SES for outgoing, bounce, and incoming email](https://meta.discourse.org/t/configuring-aws-ses-for-outgoing-bounce-and-incoming-email/263604):
>
> I thought I’d share the configuration I came up with to use AWS SES for outgoing, bounce, and incoming email. There’s definitely some nuance to the SES service, and it took a good deal of trial and error to understand exactly how it works. This is more of a brain-dump than step-by-step-follow-the-dotted-line. It should be unnecessary, but use at your own risk. And by all means always read through and understand any code written by others you implement. Background: I’m working to deploy Discours…

### Steps

1. Create a Simple Email Service (SES) domain identity, _ **your.domain** _, in one of the AWS regions supporting email receiving

- [Regions and Amazon SES - Amazon Simple Email Service](https://docs.aws.amazon.com/ses/latest/dg/regions.html#region-receive-email)

1. Verify domain identity

- [Verified identities in Amazon SES - Amazon Simple Email Service](https://docs.aws.amazon.com/ses/latest/dg/verify-addresses-and-domains.html)
- [Verifying your domain for Amazon SES email receiving - Amazon Simple Email Service](https://docs.aws.amazon.com/ses/latest/dg/receiving-email-verification.html)

1. Create a Simple Notification Service (SNS) topic, _ **feedback-sns-topic** _, for feedback notifications
2. Configure the _ **your.domain** _ domain identity  
a. Enable email feedback forwarding  
b. Configure bounce and complaint (not delivery) feedback notifications to use SNS _ **feedback-sns-topic** _ topic
3. Create a subscription on the SNS _ **feedback-sns-topic** _ topic  
a. Protocol is HTTPS (you’re not still using HTTP are you?)  
b. Set endpoint to _https:// **your.domain** /webhooks/aws_ (see [VERP post](https://meta.discourse.org/t/configure-verp-to-handle-bouncing-e-mails/45343))  
c. Select enable raw message delivery
4. Create another SNS topic, _ **incoming-sns-topic** _, for incoming email
5. Create an SES email receiving rule set, _ **inbound-mail-set** _, if there isn’t an existing active one. If so use that as there can only be one active rule set
6. Create a receipt rule in the _ **inbound-mail-set** _ receiving rule set  
a. Set recipient condition to _ **your.domain** _  
b. Add action to publish to SNS topic _ **incoming-sns-topic** _, encoding _Base64_
7. Create API key in your Discourse instance for user _system_, granting _receive email_ action on the _email_ resource
8. Create a secret in Secret Manager, _ **email-handler-secret** _, with the following keys and their respective values:

- _api\_endpoint_ - _https:// **your.domain** /admin/email/handle\_mail_
- _api\_key_ - from step 9
- _api\_username_ - _system_, unless you used something different in step 9

1. Create a Lambda layer, _ **lambda-receiver-layer** _, for the _python3.10_ runtime containing the _requests_ and _aws-lambda-powertools_ libraries
2. Create a lambda function, _ **email-receiver-lambda** _, for the _python3.10_ runtime with the receiver code:

---

<div class="post-metadata">

### Author: ![jericson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jericson/32/116215_2.png) [@jericson](https://meta.discourse.org/u/jericson)
#### Post date: [10 באפריל,‏ 2024,‏ 2:42am UTC](https://meta.discourse.org/t/fix-aws-sns-bounce/303015/3 "2024-04-10T02:42:10Z")

</div>

I haven’t done this exactly, but I do think I can help debug. Sending a PM.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [10 במאי,‏ 2024,‏ 2:42am UTC](https://meta.discourse.org/t/fix-aws-sns-bounce/303015/4 "2024-05-10T02:42:15Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
