# \`enable\_forwarded\_emails\` doesn't behave like conventional email forwarding

**URL:** https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501
**Category:** Feature
**Created:** [March 13, 2019, 5:33pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501 "2019-03-13T17:33:46Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [March 13, 2019, 5:33pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/1 "2019-03-13T17:33:47Z")

</div>

`enable_forwarded_emails` is a great feature for bringing existing conversations into Discourse, but for users who approach Discourse with a “Mailman-mind” - as many users on our instance do - this feature just doesn’t do what they’re expecting it to.

Within every email client I’ve used, forwarding an email intentionally **excludes** the original email address from the forward, and subsequent replies. Whereas with this feature, that original email address is included in the created post and subsequent replies.

If this feature isn’t enabled, then Discourse strips the actual forwarded email, which also doesn’t work for us.

My thought is there should be an alternative feature which doesn’t strip the forwarded email and posts it like so:

> Thought you all should see this:
> 
> > ---------- Forwarded message ---------  
> > From: **Example Person** \<person@example.com\>  
> > Date: Wed, 13 Mar 2019 at 15:11  
> > Subject: An email to be forwarded  
> > To: \<some\_discourse\_user@example.com\>
> > 
> > The original email

This would be a lot like the result of the `always_show_trimmed_content` setting, but with the trimmed content automatically expanded (and therefore visible in email notifications).

@zogstrip what are your thoughts here?

With just a little bit of rejigging of the code you’ve already written for `enable_forwarded_emails` I think what I want to see would be relatively easy - and that’s rejigging I’m happy to do.

Perhaps the solution here is to create a new multiple-choice site setting, something like:

`forwarded_emails_behaviour`:

- hide (default)
- show (the behaviour I’m advocating for here)
- create\_replies (the existing `enable_forwarded_emails` behaviour)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [March 16, 2019, 9:07am UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/2 "2019-03-16T09:07:43Z")

</div>

> [@LeoMcA](#):
>
> Perhaps the solution here is to create a new multiple-choice site setting, something like: `forwarded_emails_behaviour`

I like that 👍

PR at will 😉

---

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [July 24, 2019, 6:05pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/3 "2019-07-24T18:05:21Z")

</div>

> [@zogstrip](#):
>
> PR at will 😉

It took me a little while, but here’s the PR:

[https://github.com/discourse/discourse/pull/7935](https://github.com/discourse/discourse/pull/7935)

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [November 9, 2019, 2:29pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/4 "2019-11-09T14:29:31Z")

</div>

> [@LeoMcA](#):
>
> `forwarded_emails_behaviour` :
> 
> - hide (default)
> - show (the behaviour I’m advocating for here)
> - create\_replies (the existing `enable_forwarded_emails` behaviour)

Currently, this setting has these options available:

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/2/c25d1834d41e1ba2c208fa302b8cf26ea49ca135.png)

So I suppose the “show” option became “quote”?

Also, I don’t quite get why the other option is called “create replies”. What does it mean? (or: what does it do?)

---

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [November 11, 2019, 12:48pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/5 "2019-11-11T12:48:02Z")

</div>

> [@tophee](#):
>
> So I suppose the “show” option became “quote”?

Yep, as both other options “show” the forwarded email, but this one quotes in in the original post.

> [@tophee](#):
>
> Also, I don’t quite get why the other option is called “create replies”. What does it mean? (or: what does it do?)

What it says on the 🥫! It’ll attempt to parse the forwarded email, then create a staged user from the original sender of the forwarded email, and post the forwarded email as the original topic and then any text the forwarder includes as a reply to that topic (at least that’s the way round I remember it working).

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [November 11, 2019, 6:02pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/6 "2019-11-11T18:02:48Z")

</div>

> [@LeoMcA](#):
>
> then any text the forwarder includes as a reply to that topic

Aah, now I get it. It’s the text that the forwarder includes that becomes the reply! But that’s exactly _one_ reply. Why does it say create _replies_?

Another reason why the terminology is somewhat confusing: both “hide” and “quote” refer to the forwarded text but “create replies” refers to the forwarders commentary om the forwarded text. So perhaps these options could be clarified somehow by saying

- hide forwarded email
- quote forwarded email
- post forwarded mail with replies

As I write, I’m wondering whether this third option is really how it works. I don’t think it ever behaved like that for us but then again we don’t have a lot of forwarded mails, so I’m not sure. Does it even make sense to post the forwarders comment as a reply? Shouldn’t it somehow be made clear that the forwarded email was posted by the forwarder? This is not at all clear when you have the forwarder apparently reply to it.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [November 25, 2019, 11:15pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/7 "2019-11-25T23:15:53Z")

</div>

> [@LeoMcA](#):
>
> > So I suppose the “show” option became “quote”?
> 
> Yep, as both other options “show” the forwarded email, but this one quotes in in the original post.

So I’m using the quote setting and it definitely doesn’t work as described. Maybe I’m still misunderstanding the intended behaviour but this seems pretty clear:

> [@LeoMcA](#):
>
> My thought is there should be an alternative feature which doesn’t strip the forwarded email and posts it like so:
> 
> > Thought you all should see this:
> > 
> > > ---------- Forwarded message ---------  
> > > From: **Example Person** \<[person@example.com](mailto:person@example.com)\>  
> > > Date: Wed, 13 Mar 2019 at 15:11  
> > > Subject: An email to be forwarded  
> > > To: \<[some\_discourse\_user@example.com](mailto:some_discourse_user@example.com)\>
> > > 
> > > The original email

and this is not what I’m getting. So let me be mote precise in what I’m getting: someone forwarded an email starting with a short note like “Look at this” followed by the forwarded email. The forwarded email included text as well as two pdf files as attachments. The post shown on the forum looked like this:

> Look at this!  
> Cheers,  
> Sara
> 
> [document1.pdf](https://some.valid.url.on.myforum.com)  
> [document2.pdf](https://another.valid.url.on.myforum.com)

That was all.

So the forwarded email was completely stripped with the exception of the file attachments. I was able to recover it manually and it even started with `---------- Forwarded message ---------` so identifying it could not have been easier…

---

<div class="post-metadata">

### Author: ![LeoMcA](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leomca/32/87233_2.png) [@LeoMcA](https://meta.discourse.org/u/LeoMcA)
#### Post date: [November 26, 2019, 2:20pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/8 "2019-11-26T14:20:15Z")

</div>

Hmm, I wonder if the attachments are messing things up here. This is how they (correctly) appear for me: [https://discourse-dev.itsre-apps.mozit.cloud/t/fwd-email-to-site-feedback-support/24](https://discourse-dev.itsre-apps.mozit.cloud/t/fwd-email-to-site-feedback-support/24)

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [November 26, 2019, 4:04pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/9 "2019-11-26T16:04:23Z")

</div>

Okay, [that](https://discourse-dev.itsre-apps.mozit.cloud/t/fwd-email-to-site-feedback-support/24) looks just like I’d expect it. Good to see that it works at least under certain circumstances. But did your email include an attachment? If not, it seems plausible that discourse is confused by (certain?) attachments.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [February 18, 2020, 10:06pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/10 "2020-02-18T22:06:12Z")

</div>

> [@tophee](#):
>
> did your email include an attachment? If not, it seems plausible that discourse is confused by (certain?) attachments.

I’m still having issues with forwarded emails not being displayed. Since I do have at least one email with attachments that was correctly rendered, my guess is now that it has to do with whether the person forwarding the email added something to the email or not. From what I can see, emails that were forwarded without adding any text above the forwarded email were rendered correctly but if the forwarder added something like “FYI”, only the attachments are included in the post but not the text of the forwarded email.

In other words, this example still doesn’t work (because it includes “Thought you all should see this:”):

> [@LeoMcA](#):
>
> > Thought you all should see this:
> > 
> > > ---------- Forwarded message ---------  
> > > From: **Example Person** \<[person@example.com](mailto:person@example.com)\>  
> > > Date: Wed, 13 Mar 2019 at 15:11  
> > > Subject: An email to be forwarded  
> > > To: \<[some\_discourse\_user@example.com](mailto:some_discourse_user@example.com)\>
> > > 
> > > The original email

Instead of the above result, this email would be rendered as:

> Thought you all should see this:

And nothing else.

Could someone confirm whether this problem is specific to my instance or whether it exists also elsewhere?

Please check emails with an attachment in particular (e.g. a pdf file) as it is possible that the problem only occurs when text is added AND there is an attachment.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [February 21, 2020, 4:55am UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/11 "2020-02-21T04:55:13Z")

</div>

I also am still confused what these different labels/features do – trying to set up incoming email to use with the [Tickets Plugin 🎟](https://meta.discourse.org/t/tickets-plugin/97914) but getting inconsistent behavior.

I feel like the default behavior should be that whatever gets forwarded in becomes a post by the (staged or regular user) that created the message. The reason it’s getting forwarded seems to most often be that someone who got the message felt it would be better addressed on Discourse, so that topic seems most appropriate to be started by the email’s author, not the forwarder.

(But maybe my use cases are actually edge cases…)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [February 26, 2020, 3:15pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/12 "2020-02-26T15:15:01Z")

</div>

> [@downey](#):
>
> started by the email’s author, not the forwarder.

It should work that way when you set `enable_forwarded_emails` to `create_replies`. The forwarded email will be the first post and it creates a reply if the forwarder wrote some text. Otherwise it creates a small action post, so that it is clear who forwarded the first post.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [February 26, 2020, 3:36pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/13 "2020-02-26T15:36:43Z")

</div>

OK, so I think I’m finally learning –

If `create_replies` is the chosen value for the `forwarded emails behaviour` site setting, then the original message becomes the opening post in the topic, and anything written in the email **above** the forwarded message, becomes a **reply** to the topic below the 3rd party message. 😕

**Q:** Do any of the other values of this site setting – namely, `hide` or `quote` – just (only) process the original 3rd party message and nothing more?

I am wondering if the attempt to split out these “create replies” might be the cause of some [weird errors I’ve been seeing](https://meta.discourse.org/t/cant-email-forward-notifications-from-a-different-discourse-server/142586) when sending things in from a Microsoft Outlook client.

PS: I wonder, might this setting be worth a FAQ/howto entry to be linked from the description text below the site setting? It might just be me but I have rarely been so confused with a Discourse setting over the past 7 years. Or maybe I just need more ☕ 😄

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [February 26, 2020, 3:50pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/14 "2020-02-26T15:50:48Z")

</div>

> [@downey](#):
>
> **Q:** Do any of the other values of this site setting – namely, `hide` or `quote` – just (only) process the original 3rd party message and nothing more?

No. You will get a small action post when there’s no text before the forwarded message.

I believe this feature is still marked as experimental and there’s a good reason for it. Emails are usually forwarded inline. That makes it quite hard to extract the forwarded email, because each client forwards the original email headers differently. Some even hide the email address of the original `From` header or use localized headers.

It should work a lot better when emails are forwarded as attachment instead of inline (I’m 99% sure that Discourse supports this).

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [February 26, 2020, 3:56pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/15 "2020-02-26T15:56:47Z")

</div>

> [@gerhard](#):
>
> It should work a lot better when emails are forwarded as attachment instead of inline (I’m 99% sure that Discourse supports this).

I would agree that would be a much cleaner way to ensure correct processing. I wonder why I can’t get Discourse to process the attachments when I do. (The content of the forwarded attachment comes through in the raw content tagged to the post, but only the ‘commentary’ is rendered, not the forwarded original. Again, at least for MS Outlook; I’ll have to try some other clients.)

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [February 26, 2020, 3:58pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/16 "2020-02-26T15:58:49Z")

</div>

Maybe it’s not implemented after all? I haven’t looked at the code yet. 😊  
Please report back if it works with other clients.

---

<div class="post-metadata">

### Author: ![jeff\_y](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeff_y/32/200242_2.png) [@jeff\_y](https://meta.discourse.org/u/jeff_y)
#### Post date: [December 11, 2020, 8:22pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/17 "2020-12-11T20:22:17Z")

</div>

Inline forwarded messages are getting trimmed away, with both `quote` and `create_replies` modes enabled.

Any suggestions?

Original message (some headers removed):

```plaintext
From: Jeffrey Lastname <jeff@myemail.us>
To: test-cat@example.org
Subject: Fwd: Thank you for your support!
X-Mailer: MailMate (1.14r5745)
Content-Type: text/plain; format=flowed

Some really long sample text.

Forwarded message:

> From: Donations Team <giving@example2.org>
> To: jeff@myemail.us
> Subject: Thank you for your support!
>
> Dear Jeffrey,
>
> Our heartfelt thanks for your donation to Example Project, 
> especially now. Together we will write the future.

```

Message in the forum board (same for both modes):

```plaintext
Some really long sample text.

Forwarded message:

```

---

<div class="post-metadata">

### Author: ![jeff\_y](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeff_y/32/200242_2.png) [@jeff\_y](https://meta.discourse.org/u/jeff_y)
#### Post date: [December 11, 2020, 8:28pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/18 "2020-12-11T20:28:59Z")

</div>

Forwarding the message as an attachment doesn’t seem to work either. `eml` attachments are rejected. If `eml` attachments are authorized, then in “create\_replies” mode, it attaches the `eml` and the forum visitor has the option to download it.

---

<div class="post-metadata">

### Author: ![citizentools](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/citizentools/32/121368_2.png) [@citizentools](https://meta.discourse.org/u/citizentools)
#### Post date: [January 16, 2021, 8:19pm UTC](https://meta.discourse.org/t/enable-forwarded-emails-doesnt-behave-like-conventional-email-forwarding/111501/19 "2021-01-16T20:19:04Z")

</div>

Is there a way to get email notifications to show the forwarded email message?

With

- forwarded\_emails\_behaviour set to “ **quote** ” and

- always\_show\_trimmed\_content set **on** ,

our discourse website (2.6.0, stable) shows the forwarded email just as one would wish, once I click the three dots:

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

However, the email notification omits the forwarded email entirely:

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/1/51ad1d3f48fba0098214e198b3b634d6e1a7e871.png)
