The user ipoopfool is experiencing issues with Amazon SES/SNS email handling in Discourse, specifically regarding missing bounce and complaint notifications. Despite following setup instructions, rejected emails are not appearing in the Discourse email rejected tab, even when testing with SES’s mailbox simulator. Additionally, clicking on bounced email rows results in a Discourse::NotFound error, with no relevant logs found. Jonathan5 notes that Discourse’s email handling is inconsistent, while renato confirms the setup has broken over time. The user suggests using AWS CloudWatch to manually track complaints via log insights, but the core issue of missing SES data in Discourse remains unresolved. shyguy asks for updates on the matter.
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.
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.
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.
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.