`enable_forwarded_emails` doesn't behave like conventional email forwarding

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)
9 Likes

I like that :+1:

PR at will :wink:

5 Likes

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

8 Likes

Currently, this setting has these options available:

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

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

What it says on the :canned_food:! 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).

3 Likes

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.

2 Likes

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:

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
document2.pdf

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…

Hmm, I wonder if the attachments are messing things up here. This is how they (correctly) appear for me: Fwd: email to site-feedback.support - Support - Mozilla Discourse Dev

2 Likes

Okay, that 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.