# "Discourse::NotFound" error when click "Email Type" field on admin/email/bounced

**URL:** https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011
**Category:** Self-hosting
**Tags:** email
**Created:** [January 13, 2021, 7:26pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011 "2021-01-13T19:26:24Z")
**Posts on this page:** 20
**Page:** 1

<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: [January 13, 2021, 7:26pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/1 "2021-01-13T19:26:24Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [January 13, 2021, 8:05pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/2 "2021-01-13T20:05:27Z")

</div>

> [@Jonathan5](#):
>
> 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.

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.

---

<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: [January 13, 2021, 8:55pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/3 "2021-01-13T20:55:30Z")

</div>

Thanks. For outgoing mail I’m using Mailgun. I think I used Discourse’s recommended settings.

For incoming mail I’m using this [Configure direct-delivery incoming email for self-hosted sites with Mail-Receiver](https://meta.discourse.org/t/straightforward-direct-delivery-incoming-mail/49487) But I’ve never updated it since installation - might that be the problem? As it’s `./launcher rebuild app` for Discourse, is it ` ./launcher rebuild mail-receiver`?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [January 14, 2021, 3:33pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/4 "2021-01-14T15:33:16Z")

</div>

Yes, that’s how to upgrade it. It’s been a while since the last update, I think, but a good first stop) step would be to upgrade it and discourse.

---

<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: [February 4, 2021, 6:26pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/5 "2021-02-04T18:26:56Z")

</div>

I have upgraded both and still get the same error, including (I think) for emails received since the upgrade. Any further ideas?

---

<div class="post-metadata">

### Author: ![jrivettcsa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jrivettcsa/32/151272_2.png) [@jrivettcsa](https://meta.discourse.org/u/jrivettcsa)
#### Post date: [February 16, 2021, 4:00am UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/6 "2021-02-16T04:00:23Z")

</div>

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.

---

<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: [February 26, 2021, 8:28am UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/7 "2021-02-26T08:28:56Z")

</div>

> [@simon](#):
>
> I’m wondering is the issue is related to how your mail server handles forwarding the bounce message.

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.

---

<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: [May 12, 2021, 1:00pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/8 "2021-05-12T13:00:18Z")

</div>

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”

[https://documentation.mailgun.com/en/latest/api-bounces.html#examples](https://documentation.mailgun.com/en/latest/api-bounces.html#examples)

If not then at least we need a sensible error message to explain why the link doesn’t work 🙂

---

<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: [December 5, 2021, 10:07am UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/9 "2021-12-05T10:07:50Z")

</div>

Has any work been done on this. I’d be very grateful if there had 🙂

I use Digital Ocean and Mailgun (ie the main recommendations) so imagine it’s not just me with the problem.

---

<div class="post-metadata">

### Author: ![Wolftallemo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wolftallemo/32/289645_2.png) [@Wolftallemo](https://meta.discourse.org/u/Wolftallemo)
#### Post date: [March 8, 2022, 9:00am UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/10 "2022-03-08T09:00:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![jrivettcsa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jrivettcsa/32/151272_2.png) [@jrivettcsa](https://meta.discourse.org/u/jrivettcsa)
#### Post date: [March 9, 2022, 1:50pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/11 "2022-03-09T13:50:09Z")

</div>

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](https://meta.discourse.org/t/handling-bouncing-e-mails/45343)).

---

<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: [January 8, 2023, 2:39pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/12 "2023-01-08T14:39:25Z")

</div>

I’ve just noticed stacks of warnings in the error log along these lines:

```plaintext
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.

---

<div class="post-metadata">

### Author: ![jrivettcsa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jrivettcsa/32/151272_2.png) [@jrivettcsa](https://meta.discourse.org/u/jrivettcsa)
#### Post date: [January 8, 2023, 6:22pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/13 "2023-01-08T18:22:09Z")

</div>

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”.

---

<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: [January 8, 2023, 7:28pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/14 "2023-01-08T19:28:26Z")

</div>

> [@jrivettcsa](#):
>
> I’m not seeing those errors in the logs

What if you tick “Warning”?

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/6/9/d69611eafff02ede30c651ba3c01ab6535af14c3.jpeg)

---

<div class="post-metadata">

### Author: ![jrivettcsa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jrivettcsa/32/151272_2.png) [@jrivettcsa](https://meta.discourse.org/u/jrivettcsa)
#### Post date: [January 9, 2023, 6:25pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/15 "2023-01-09T18:25:00Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [February 23, 2023, 4:12pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/16 "2023-02-23T16:12:50Z")

</div>

I’ve got the same issue with Mailgun. Different host, so it isn’t that!

I wonder if there is a problem with the Mailgun config instructions for VERP setup:

> [@Configure VERP to handle bouncing e-mails](https://meta.discourse.org/t/configure-verp-to-handle-bouncing-e-mails/45343#mailgun-1):
>
> 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…

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [February 28, 2023, 2:52am UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/17 "2023-02-28T02:52:49Z")

</div>

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):

> ![Screenshot 2023-02-28 15.46.49](https://global.discourse-cdn.com/meta/original/4X/b/7/3/b73a5e3b8d8537a495891d1d007663cd2ce998e8.png)

When I click on these I get this:

> ![image](https://global.discourse-cdn.com/meta/original/4X/5/3/9/539e6118528d87c550a6d335e6a872423b131d27.png)

Looking into the page code, the anchor tags in the HTML seems to be missing the `href` altogther:

> ![image](https://global.discourse-cdn.com/meta/original/4X/3/2/b/32bab35e8ac9021b10dd2da1dbb326f11ca4e8c3.png)

I’ve got VERP configured for Mailgun, and it seems to be working well otherwise.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 28, 2023, 3:34pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/18 "2023-02-28T15:34:11Z")

</div>

> [@nathankershaw](#):
>
> When I click on these I get this:
> 
> > ![image](https://global.discourse-cdn.com/meta/original/4X/5/3/9/539e6118528d87c550a6d335e6a872423b131d27.png)

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.

Can you double check and run the test according to [Configure VERP to handle bouncing e-mails](https://meta.discourse.org/t/configure-verp-to-handle-bouncing-e-mails/45343) ?

---

<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: [March 1, 2023, 9:52am UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/19 "2023-03-01T09:52:24Z")

</div>

> [@Falco](#):
>
> 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.

A better message would be good in that case.

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?

If it is right – would there be any way for those details to be sent to Discourse and recorded and displayed in the same place as bounces received by Discourse? I think the Mailgun API would allow that (["Discourse::NotFound" error when click "Email Type" field on admin/email/bounced - #8 by Jonathan5](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/8)).

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.)

---

<div class="post-metadata">

### Author: ![jrivettcsa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jrivettcsa/32/151272_2.png) [@jrivettcsa](https://meta.discourse.org/u/jrivettcsa)
#### Post date: [March 1, 2023, 11:44pm UTC](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011/20 "2023-03-01T23:44:39Z")

</div>

> [@Jonathan5](#):
>
> A better message would be good in that case.

Agreed. If something isn’t _actually_ broken, it should not _appear_ to be broken. Discourse can surely provide a more reassuring message.

[Next page](https://meta.discourse.org/t/discourse-notfound-error-when-click-email-type-field-on-admin-email-bounced/176011.md?page=2)
