Amazon SES/SNS email complaints not received, bounces missing information

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, no rejected emails show up.

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

image

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

1 Like

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

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

1 Like

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.

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 & Targeting Blog (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.
fields complaint.complainedRecipients.0.emailAddress as email
| limit 500
| stats count(*) as count by email
| sort count desc

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.