# תלונות דוא"ל של Amazon SES/SNS לא מתקבלות, חסר מידע על נטישת דואר

**URL:** https://meta.discourse.org/t/amazon-ses-sns-email-complaints-not-received-bounces-missing-information/239247
**Category:** Self-hosting
**Tags:** email
**Created:** [16 בספטמבר,‏ 2022,‏ 11:59pm UTC](https://meta.discourse.org/t/amazon-ses-sns-email-complaints-not-received-bounces-missing-information/239247 "2022-09-16T23:59:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ipoopfool](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@ipoopfool](https://meta.discourse.org/u/ipoopfool)
#### Post date: [16 בספטמבר,‏ 2022,‏ 11:59pm UTC](https://meta.discourse.org/t/amazon-ses-sns-email-complaints-not-received-bounces-missing-information/239247/1 "2022-09-16T23:59:48Z")

</div>

> [@Configure VERP to handle bouncing e-mails](https://meta.discourse.org/t/handling-bouncing-e-mails/45343):
>
> Setting up bounces handling Discourse uses the [Variable envelope return path (VERP)](https://en.wikipedia.org/wiki/Variable_envelope_return_path) technique to handle bouncing e-mails. To enable VERP, set the “reply by email address” site setting with an email address template that uses the + sign. The default of replies+%{reply\_key}@discourse.example.com … works fine. If you are using your own or your company’s email server, then, that’s it tada Your discourse instance must be able to receive email sent to this address. This should work via POP, bu…

I followed the instructions linked above and set up SES with SNS email forwarding. I’m running into two problems.

# 1. Rejected/complaint emails not being received by Discourse

I’m currently receiving a spike in SES email complaints so I really need to be receiving and handling email rejections. However, setting it up with the above instructions does not yield any results in the email rejected tab even though bounces are coming through.

Even when I send emails to [SES’s mailbox simulator](https://aws.amazon.com/blogs/aws/mailbox-simulator-for-the-amazon-simple-email-service/), no rejected emails show up.

# 2. Bounced email details showing a `Discourse::NotFound` error

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/b/5/cb50c3d97d6996ae3060604942bcc7935ce1153a.png)

When I click the (i) icon in any bounced email row, it gives me an error.

With the email logging setting turned on and checking the /logs url, I am not able to find anything obviously wrong in the logs when using the filter term “mail”.

This seems to be the case regardless if I have SES’s “Include original headers” setting turned on or not.

* * *

# Related topics I found

> [@"Discourse::NotFound" error when click "Email Type" field on admin/email/bounced](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011):
>
> I think clicking on an “Email Type” field, e.g. user\_watching\_first\_post is meant to display details of the bounce message received from the intended recipient. But on my self-hosted site I get the error message stated above. Is there anything I can do to fix this? Thanks.

> [@Bounced e-mails from Amazon SES/SNS not working](https://meta.discourse.org/t/bounced-e-mails-from-amazon-ses-sns-not-working/200209):
>
> I was aware that Discourse offers an endpoint to handle SNS notifications from Amazon SES. The endpoint is /webhooks/aws, and here is where I got aware of it: [https://meta.discourse.org/t/handling-bouncing-e-mails/45343/177?u=wlandgraf](https://meta.discourse.org/t/handling-bouncing-e-mails/45343/177) Everything is “almost” working. I can see that AWS is sending the notifications to that endpoint, via CloudWatch log. I also see that Discourse is responding the notification with successful status code (200), after I configured it to send the raw message. Howe…

---

<div class="post-metadata">

### Author: ![ipoopfool](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@ipoopfool](https://meta.discourse.org/u/ipoopfool)
#### Post date: [17 בספטמבר,‏ 2022,‏ 2:10am UTC](https://meta.discourse.org/t/amazon-ses-sns-email-complaints-not-received-bounces-missing-information/239247/2 "2022-09-17T02:10:37Z")

</div>

digging through web archive because I’m stubborn and want to see the deleted messages on the setup instructions lol [Handling bouncing e-mails - admins - Discourse Meta](https://web.archive.org/web/20211022170803/https://meta.discourse.org/t/handling-bouncing-e-mails/45343?page=9)

@renato looks like you figured out the latest setup instructions for SES email forwarding. Have you encountered the issues I’m facing at all?

---

<div class="post-metadata">

### Author: ![Jonathan5](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathan5/32/197134_2.png) [@Jonathan5](https://meta.discourse.org/u/Jonathan5)
#### Post date: [17 בספטמבר,‏ 2022,‏ 9:17am UTC](https://meta.discourse.org/t/amazon-ses-sns-email-complaints-not-received-bounces-missing-information/239247/3 "2022-09-17T09:17:26Z")

</div>

Discourse is an amazing forum but it’s email handling is a bit haphazard. I’ve given up on searching for answers or achieving perfection, as haphazard has been good enough. But I would still be interested in the answers to your questions, partly because I am considering moving from Mailgun to the cheaper Amazon SES.

---

<div class="post-metadata">

### Author: ![ipoopfool](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@ipoopfool](https://meta.discourse.org/u/ipoopfool)
#### Post date: [19 בספטמבר,‏ 2022,‏ 3:47am UTC](https://meta.discourse.org/t/amazon-ses-sns-email-complaints-not-received-bounces-missing-information/239247/4 "2022-09-19T03:47:56Z")

</div>

This is what I’m currently doing as a manual workaround for rejections. But I’d still love to figure out the ‘right’ solution for both rejections and bounces in SES.

* * *

SES also doesn’t report complaint emails by default. Use these instructions to hook it up to CloudWatch to gather more info. [How to Log Amazon SES details using Amazon CloudWatch | AWS Messaging Blog](https://aws.amazon.com/blogs/messaging-and-targeting/how-to-log-amazon-ses-details-using-amazon-cloudwatch/) (I had to manually update the included template to a newer version of Python to make it work)

This creates a CloudWatch \> Logs \> Log groups item for complaint emails, assuming you selected this option. You can see a list of emails sent and dig in to see the exact email address.

And then you can use CloudWatch \> Log Insights to query the data for a simpler summary.

- Make sure to set your time span to what you want to look at. This resets on every page load.
- I saved the below query for future use. You can find it in the right bar \> queries \> saved queries. But it’s kind of hard to see it. Ctrl+F if needed.

```plaintext
fields complaint.complainedRecipients.0.emailAddress as email
| limit 500
| stats count(*) as count by email
| sort count desc

```

---

<div class="post-metadata">

### Author: ![renato](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/renato/32/383632_2.png) [@renato](https://meta.discourse.org/u/renato)
#### Post date: [6 בדצמבר,‏ 2022,‏ 12:34pm UTC](https://meta.discourse.org/t/amazon-ses-sns-email-complaints-not-received-bounces-missing-information/239247/5 "2022-12-06T12:34:04Z")

</div>

Yeah, the configuration has worked for me in the past when I made that post, but it has been broken for some time now, I don’t see any bounced e-mails on Discourse anymore.

---

<div class="post-metadata">

### Author: ![shyguy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shyguy/32/295079_2.png) [@shyguy](https://meta.discourse.org/u/shyguy)
#### Post date: [6 באפריל,‏ 2023,‏ 5:07pm UTC](https://meta.discourse.org/t/amazon-ses-sns-email-complaints-not-received-bounces-missing-information/239247/6 "2023-04-06T17:07:41Z")

</div>

any updates on this?
