Users report a “Discourse::NotFound” error when clicking the “Email Type” field in the admin/email/bounced section, which is meant to display bounce message details. Jonathan5 and others using Mailgun as their email provider suspect the issue stems from Mailgun’s webhook system not forwarding full bounce details to Discourse — only error codes and messages, not the actual bounce email. simon confirms the feature works on hosted Discourse but suggests mail server configuration may be the culprit. Jonathan5 and pfaffman attempt upgrades to the mail-receiver and Discourse, but the issue persists. Wolftallemo and jrivettcsa confirm bounces aren’t being received by Discourse’s mail receiver, and Jonathan5 finds AutoGeneratedEmailError warnings in logs, suggesting Discourse rejects bounce emails as auto-generated. nathank observes missing href links in the HTML, confirming no data is available. Falco explains the error is expected if Discourse doesn’t receive the bounce email — which occurs when using third-party providers like Mailgun. Users agree a clearer error message would help Jonathan5, jrivettcsa. LotusJeff suggests updating documentation to clarify this limitation. Jonathan5 eventually switches to Amazon SES and confirms the error disappears for new bounces — proving the issue is Mailgun-specific. The core problem remains: Discourse cannot display bounce details unless it directly receives the full bounce email, which Mailgun’s webhook system does not provide.
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?
That is correct. I’ve just checked this on my hosted Discourse site and it’s working without any problems. If your site is on the latest version of Discourse, I’m wondering is the issue is related to how your mail server handles forwarding the bounce message.
Same problem here. Self-hosted, up to date. Bounces being handled the recommended way. Links from before we changed to proper bounce handling work fine.
Yes likely Discourse isn’t getting it from Mailgun. I don’t know how the webhooks work but suspect it just tells Discourse there has been a temporary/permanent failure without sending the bounce message.
Is there any way to make this Discourse feature work with Mailgun?
It should be possible to show at least the error code and message:
Both SMTP error code and SMTP error message are preserved
“code”: 550,
“address”: “'baz@example.com”,
“error”: “Message was not accepted – invalid mailbox. Local mailbox 'baz@example.com is unavailable: user not found”
After my own testing it seems in many cases, bounces are not received by the mail receiver at all. (I only found a connection attempt for one, which was promptly lost). I’m not seeing the Return-Path header being set at all (is it supposed to be?) which makes me think that they’re not even being sent back most of the time.
Still a problem here as well. Despite my earlier statement, it now appears that none of these links work, going back to site startup. Initially it only seemed to affect bounces from before we started handling bounces properly (Configure VERP to handle bouncing e-mails).
I’ve just noticed stacks of warnings in the error log along these lines:
Email can not be processed: Email::Receiver::AutoGeneratedEmailError
Received: from ...
for <bounce+f7e463.5f70e9-...@forum.example.com>; ...
Subject: Your message couldn't be delivered
Perhaps this is why Discourse doesn’t have any details for the bounced emails.
I’m not seeing those errors in the logs, but the problem persists. When I click the Email Type value for an entry in the Bounced email list, I get “An error occurred: Discourse::NotFound”.
It was already selected. I went back a bit further in the log, and while I do see the occasional email-related message, I’m not seeing the ones you mentioned.
This has been there for a little while, but it has only just started causing problems as I aim to investigate why I’m getting so many bounces at present.
The issue seems to be that there is no link in the Email Type column and nothing behind the icon (red arrows):
That is the expected behavior when the bounced response was not processed by Discourse. The feature is working fine if Discourse receives the bounces, otherwise it will show that response for all bounces.
I think you mean that if Discourse only finds out about the bounce from a Mailgun webhook then the details of the bounce never get sent to Discourse. Is that right?
In what circumstance would Discourse handle bounces rather than the external email service? (I know Discourse can bounce/reject emails, but I mean handling bounce messages received from intended email recipients.)